1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 07:48:11 +00:00

TextEditor: Use ArgsParser and allow the user to specify preview mode

This makes looking at HTML files that somehow fail a little less
painful by allowing the user to actually _see_ the html.
This commit is contained in:
AnotherTest 2020-07-06 18:48:49 +04:30 committed by Andreas Kling
parent 5cdb0ef2e5
commit a163ee8b3b
3 changed files with 36 additions and 8 deletions

View file

@ -497,12 +497,14 @@ void TextEditorWidget::set_path(const LexicalPath& lexical_path)
m_plain_text_highlight->activate();
}
if (m_extension == "md")
set_preview_mode(PreviewMode::Markdown);
else if (m_extension == "html")
set_preview_mode(PreviewMode::HTML);
else
set_preview_mode(PreviewMode::None);
if (m_auto_detect_preview_mode) {
if (m_extension == "md")
set_preview_mode(PreviewMode::Markdown);
else if (m_extension == "html")
set_preview_mode(PreviewMode::HTML);
else
set_preview_mode(PreviewMode::None);
}
update_title();
}