SUMMARY After having used a .kateconfig file for a long time (mostly for file type-dependent tab-related settings), I wanted to also use it to change the font for some file types. First I was happy to see that there is in fact a documented variable for this but then I was disappointed to see that it had no effect. Only by chance did I notice that after reloading the file (by pressing F5) the setting was actually applied. STEPS TO REPRODUCE 1. If you do not have one already, create a .kateconfig file in your home directory. (Learn about [kateconfig-files](https://kate-editor.org/2006/02/09/kateconfig-files/) if you want to. 2. Add a modeline like the following `kate-wildcard(*.txt): word-wrap-column 20; font-size 18; font Noto Sans;`. The `word-wrap-column 20` is just for testing (this should work), the specific `font` does not matter -- pick any font you have installed (non-mono for more obvious effect). Learn about [kate-modelines](https://kate-editor.org/2006/02/09/kate-modelines/) if you want to. 3. Open a file ending in `.txt`. OBSERVED RESULT You will see your default font (and the marker line after 20 columns). EXPECTED RESULT You will see a large non-mono font. SOFTWARE/OS VERSIONS Linux: openSUSE 15.6 KDE Plasma Version: 5.27.11 KDE Frameworks Version: 5.115.0 Qt Version: 5.15.12
The bug says some settings are applied after a reload. Can you let me know one or two settings that are applied without a reload for testing purposes? I want to confirm if this is behavior by design or inconsistent behavior. Note: The current documentation doesn't mention whether it's expected that the user needs to reload a document to reflect changes in the .kateconfig file https://docs.kde.org/stable5/en/kate/katepart/config-variables.html
(In reply to TraceyC from comment #1) > The bug says some settings are applied after a reload. Can you let me know > one or two settings that are applied without a reload for testing purposes? > I want to confirm if this is behavior by design or inconsistent behavior. > > Note: The current documentation doesn't mention whether it's expected that > the user needs to reload a document to reflect changes in the .kateconfig > file > https://docs.kde.org/stable5/en/kate/katepart/config-variables.html One thing that works directly (after opening a fitting file) is the *word-wrap-column* variable (as given in the original report). Another example is *replace-tabs* (off/on). This is definitely the intention; you cannot expect people to open a file and then immediately manually reload it, just to get the settings applied. The inconsistent behavior is the font family and size, which requires this kind of reload.
Thank you for replying. I was able to replicate the inconsistent behavior you're seeing by creating a new .kateconfig file and experimenting with the values you mentioned. kate: word-wrap-column 20; This is applied right away to the .kateconfig file itself but not other files in a session It is applied when opening a file, as you observed, and also if reloading the file with F5 kate-wildcard(*.txt): word-wrap-column 20; font-size 18; font Noto Sans; When opening a text file, I observed - The word wrap is correctly at 20 columns without needing to reload the file - The font is *not* set to Noto Sans, it is using the same font as other files - Reloading the file with F5 changes the font to the one specified
Git commit 58a165c5e067b780a260bb0e10a0b50e2b7f3715 by Waqar Ahmed. Committed on 29/09/2024 at 17:55. Pushed by cullmann into branch 'master'. Read dir kateconfig on view creation M +43 -30 src/document/katedocument.cpp M +14 -4 src/document/katedocument.h https://invent.kde.org/frameworks/ktexteditor/-/commit/58a165c5e067b780a260bb0e10a0b50e2b7f3715
Thank you! :-)