diff --git a/src/source.cpp b/src/source.cpp index 39e5864..cbbc8b9 100644 --- a/src/source.cpp +++ b/src/source.cpp @@ -767,6 +767,21 @@ void Source::View::setup_format_style(bool is_generic_view) { shown = true; } + if(!prettier.empty() && !prefer_prettier) { + auto search_path = file_path.parent_path(); + auto file = ".prettier-" + language_id; + while(true) { + boost::system::error_code ec; + if(boost::filesystem::exists(search_path / file, ec)) { + prefer_prettier = true; + break; + } + if(search_path == search_path.root_directory()) + break; + search_path = search_path.parent_path(); + } + } + if(!prettier.empty() && prefer_prettier) { if(is_generic_view) { goto_next_diagnostic = [this] {