From 5f6c67458e74a047073370aa0138b3159792741d Mon Sep 17 00:00:00 2001 From: eidheim Date: Wed, 6 Nov 2019 11:03:48 +0100 Subject: [PATCH] Fixed prettier error message parsing, and can now run prettier on HTML files --- src/source.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/source.cc b/src/source.cc index e81b4ce..1809dd2 100644 --- a/src/source.cc +++ b/src/source.cc @@ -641,7 +641,7 @@ void Source::View::setup_signals() { void Source::View::setup_format_style(bool is_generic_view) { static auto prettier = filesystem::find_executable("prettier"); if(!prettier.empty() && language && - (language->get_id() == "js" || language->get_id() == "json" || language->get_id() == "css")) { + (language->get_id() == "js" || language->get_id() == "json" || language->get_id() == "css" || language->get_id() == "html")) { if(is_generic_view) { goto_next_diagnostic = [this] { place_cursor_at_next_diagnostic(); @@ -721,7 +721,7 @@ void Source::View::setup_format_style(bool is_generic_view) { } } else if(is_generic_view) { - static std::regex regex(R"(^\[error\] stdin: (.*) \(([0-9]*):([0-9]*)\)$)"); + static std::regex regex(R"(^\[error\] [^:]*: (.*) \(([0-9]*):([0-9]*)\)$)"); std::string line; std::getline(stderr_stream, line); std::smatch sm;