Skip to content

Commit

Permalink
TextEditorPlugin: prevent a warning on load
Browse files Browse the repository at this point in the history
By default zoom level is "-1", meaning "leave as is". The code until now
tried to set fontsize to "-1", this was the warning seen in the console
on each load.
  • Loading branch information
diegoiast committed Feb 1, 2025
1 parent 6b53b8a commit 8562227
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/plugins/texteditor/texteditor_plg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -414,10 +414,12 @@ bool TextEditorPlugin::openFile(const QString &fileName, int x, int y, int zoom)

// In the future - the zoom, will be used to set state to the lines, if the value is really
// large. I will assume that font size bigger than 500 is not really existent.
if (zoom < 1000000) {
if (0 < zoom && zoom < 1000000) {
auto f = editor->font();
f.setPointSize(zoom);
editor->setFont(f);
} else {
// Commands non i
}

auto langInfo = ::Qutepart::chooseLanguage({}, {}, fileName);
Expand Down

0 comments on commit 8562227

Please sign in to comment.