Browse Source

Temporary solution to enable prettier plugins: add a file, for instance .prettier-sql, to enable prettier for sql files in that directory and its subdirectories

merge-requests/413/head
eidheim 3 years ago
parent
commit
e566cb8487
  1. 15
      src/source.cpp

15
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] {

Loading…
Cancel
Save