Closed epasveer closed 1 year ago
Couldn't get QPlainTextEdit::setTabStopDistance() to work. QFont::setLetterSpacing() didn't help either.
In fact, all things failed to render tab characters correctly. Most notably, if one uses the scrollwheel to zoom in or out of a QPlainTextEdit, the tab stops really get messed up.
Adding a Seer::expandTab(QString) function to expand any tabs works well. But I'm surprised QPlainTextEdit is so broken.
Added a 'tab size' option to the Editor config page.
Take this source file that contains tabs. (The arrows are tab characters).
Seer uses QPlainTextEdit widget, which has a default tab width of 80 pixels. The rendered text is way off.
Setting QPlainTextEdit's 'tabStopSpacing' to 4 mono-spaced characters is close, but not good enough. Probably doesn't handle where the tab occurs in the string.
Applying an 'expandtab' function on the string will replace tabs with the correct spacing, no matter where the tab occurs. This requires a 'tab size' parameter in the Editor settings dialog.