Bug 457243 - [Feature request] Update syntax highlighting when file with theme configuration is changed!
Summary: [Feature request] Update syntax highlighting when file with theme configurati...
Status: RESOLVED WORKSFORME
Alias: None
Product: frameworks-ktexteditor
Classification: Frameworks and Libraries
Component: general (other bugs)
Version First Reported In: unspecified
Platform: Other All
: NOR wishlist
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-07-28 17:56 UTC by dave.nextgen
Modified: 2023-05-29 03:45 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dave.nextgen 2022-07-28 17:56:33 UTC
Please add hook to file for selected syntax highlighting theme to automatically reload configuration when is changed!

Now I have to use dirty hack which I don't want...
cwid=$(xdotool getactivewindow)
for ((i=0,s=$(xdotool get_num_desktops); i<=s; i++)); do
	xdotool search --desktop $i --class kate | while read -r wid; do
		xdotool windowactivate --sync $wid key F7 type reload-highlighting
		xdotool key --delay 100 --window $wid Return
	done
done
xdotool windowactivate --sync $cwid
Comment 1 Christoph Cullmann 2022-08-25 19:46:51 UTC
Hmm, you mean to auto-reload if you altered some .theme file on disk and not via the config dialog in the current instance?
Comment 2 dave.nextgen 2022-08-26 18:30:29 UTC
Yes. Or just add "reload-highlighting" action to dbus!

Or even better. Add "reload-instance" action to dbus witch will reopen/reload kate instance and consequently reloaded all the configuration, theme, icons, styles! Because Kate always have a problems or glitches with adopting new stuff or handling with changes on the filesystem itself, so better reload everything!
Comment 3 Christoph Cullmann 2022-08-26 21:20:32 UTC
I don't think there is some proper way to regenerate everything, e.g. we cache icons in a lot of places, that will not be something that is to achieve with I think too much work to be worth the hassle.

But I can see a point in having some easy way to trigger highlighting reloading at least.
Comment 4 dave.nextgen 2022-08-27 11:30:30 UTC
"we cache icons in a lot of places..."

Please don't do that! Because again, you don't watch when things changes! 
I opened a ticket here: https://bugs.kde.org/show_bug.cgi?id=457261

I don't know exactly how kde framework work, but let's say:
- I tinted all action icons to red color
- now I touch qt5ct configuration file
- because qt5ct watch out for changes on own configuration file (lol), now somehow tells all kde applications: "hey, icons are changed! update icons with new ones!"
-ALL other kde applications adopt new icons correctly, just kate fails, because you cache and don't watch!
Comment 5 Waqar Ahmed 2022-08-27 11:45:05 UTC
> Please don't do that! Because again, you don't watch when things changes! 

You have no idea what you are talking about and no idea what is cached and what is not so stop with the "don't do that" stuff. 

However, for the record, in Ktexteditor and Kate, we usually _do not_ cache icons. There's actually very few places where icons are cached and those places are generally some kind of list or treeview. For menus and toolbars we don't do any caching anywhere in kate IIRC. Thus, it's highly likely your other bug is not a Kate bug, but a problem in some framework.
Comment 6 dave.nextgen 2022-08-27 13:01:33 UTC
I just quoted what Christoph says!

Actually I don't care who have problem with what.., kate does not correctly adopt new icons when icon theme is changed and that's all what matters! And that in whole application, not just toolbars and menus!
Comment 7 Christoph Cullmann 2022-08-27 15:28:21 UTC
If all other KDE applications work, that is strange, we don't do special handling of the icons in e.g. menus or toolbars in most cases.
If they don't change, that is a generic issue.
Are Kate and the other KDE applications installed the same way?
Comment 8 Christoph Cullmann 2023-04-29 15:04:53 UTC
As Waqar said, we only cache a few icons, if in general that doesn't work for you with Kate for all stuff there, this looks more like a issue in your distro.
Comment 9 Bug Janitor Service 2023-05-14 03:45:57 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 10 Bug Janitor Service 2023-05-29 03:45:14 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!