Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix cursor anomaly issue #899

Merged
merged 1 commit into from
Sep 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/plugins/codeeditor/gui/private/texteditor_p.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ void TextEditorPrivate::updateSettings()
QFont font(fontName, fontSize, QFont::Normal);
if (q->lexer())
q->lexer()->setDefaultFont(font);
else
else if (!fileName.isEmpty())
q->setFont(font);

int fontZoom = EditorSettings::instance()->value(Node::FontColor, Group::FontGroup, Key::FontZoom, 100).toInt();
Expand Down Expand Up @@ -215,13 +215,14 @@ void TextEditorPrivate::loadLexer()

using namespace support_file;
auto id = Language::id(fileName);
QFont font(fontName, fontSize, QFont::Normal);
if (auto lexer = LexerManager::instance()->createSciLexer(id, fileName)) {
lexer->setParent(q);
QFont font(fontName, fontSize, QFont::Normal);
lexer->setDefaultFont(font);
q->setLexer(lexer);
setMarginVisible(FoldingMargin, true);
} else {
q->setFont(font);
setMarginVisible(FoldingMargin, false);
}
}
Expand Down
Loading