SUMMARY The search functionality in KWrite has a bug that makes the given search string disappear when the user tries to go through the highlighted results. I think that this bug has appeared in the last couple of minor releases. This bug has been reproduced in both the official KWrite flatpak (from Flathub) and also in the native Fedora rpm package. STEPS TO REPRODUCE 1. Open a text file in KWrite 2. Press Ctrl+F to enable the search functionality. The "Find" textfield should now appear at the bottom of the program. 3. Enter a string value to search for. 4. Click on the button "Up" ("Jump to previous match") or the button "Down" ("Jump to next match") next to the textfield. OBSERVED RESULT The string disappears from the textfield "Find". This is obviously a bug. EXPECTED RESULT The given string should remains in the textfield "Find". SOFTWARE/OS VERSIONS Operating System: Fedora Linux 41 KDE Plasma Version: 6.3.2 KDE Frameworks Version: 6.11.0 Qt Version: 6.8.2 Kernel Version: 6.13.5-200.fc41.x86_64 (64-bit) Graphics Platform: Wayland Processors: 4 × Intel® Core™ i7-4510U CPU @ 2.00GHz Memory: 5.7 GiB of RAM Graphics Processor 1: Mesa Intel® HD Graphics 4400 Graphics Processor 2: llvmpipe Manufacturer: LENOVO Product Name: 20351 System Version: Lenovo G50-70
Hi - I can't reproduce this bug on Fedora KDE 41, using either the RPM or Flatpak package. Just to check, are there any messages printed to the console if you run KWrite from a terminal and then trigger the bug?
(In reply to John Kizer from comment #1) > Hi - I can't reproduce this bug on Fedora KDE 41, using either the RPM or > Flatpak package. > > Just to check, are there any messages printed to the console if you run > KWrite from a terminal and then trigger the bug? Hi, thanks for taking an interest in this. I just tested in the latest Flatpak (from Flathub) through the terminal as you asked running the command "flatpak run org.kde.kwrite" gives me: libkate.time: All plugins loaded in 0 ms libkate.time: Created KateMainWindow in 68 ms (while reproducing the bug nothing appears in the terminal) Exiting the program gives me: kf.notifications: Failed to play sound with canberra: Not available QThreadStorage: Thread 0x556c3a7223a0 exited after QThreadStorage 9 destroyed
Created attachment 179880 [details] Video capture I have attached a brief video capture that demonstrates the problem.
Just for the record I just attempted to downgrade my KWrite flatpak using hashes from prior versions of the program. To my surprise the bug can be reproduced in older versions also, even though this bug first occurred in my system after an update in early 2025. I went as far back as 24.02.0 and it occurs there also. This makes me suspect that the bug might not be in the KWrite code itself but perhaps in some of its dependencies?
Thanks for the video reproduction! Just to check, what steps had taken place before the start of that video to have a blank Find bar already open there? And, does the issue occur in a newly-created user profile on your device, with no customization applied?
(In reply to John Kizer from comment #5) > Thanks for the video reproduction! Just to check, what steps had taken place > before the start of that video to have a blank Find bar already open there? > > And, does the issue occur in a newly-created user profile on your device, > with no customization applied? Happy to help any way I can! I open the Find bar with the shortcut: "Ctrl + F" I just tested with a new user account as you advised and indeed KWrite (flatpak) 24.12.3 is working correctly! Does this still count as a KDE bug? Please let me know if there are any other data I can provide. (list of packages, kwrite settings files etc)
Ah - well, that gives a lead for investigation! Could you perhaps try incrementally changing your KWrite settings on that new account to match the ones on your existing account? That way, it would hopefully be possible to pin down one that triggers the behavior - hopefully in a way that can then also be reproduced on another device! :-)
(In reply to John Kizer from comment #7) > Ah - well, that gives a lead for investigation! Could you perhaps try > incrementally changing your KWrite settings on that new account to match the > ones on your existing account? That way, it would hopefully be possible to > pin down one that triggers the behavior - hopefully in a way that can then > also be reproduced on another device! :-) Good suggestion. I will give it a go when I get some free time.
Progress! I have been able to narrow it down considerably. I used KDiff3 to compare my custom kwriterc and the default one. I kept a backup of the original and I started adding my custom sections of the kwriterc one by one to see after which one I would be able to trigger the bug. I was able to reproduce the bug right after I added the following segment to kwriterc: [KTextEditor::Search] Replace History= Search History= <--- This is the culprit I think. Has this been deprecated perhaps? After I triggered the error I tried to delete this segment from kwriterc and to my surprise after I relaunched KWrite the bug persisted. I was able to resolve the bug when I restored my initial backup of kwriterc. I will attach my custom kwriterc just in case it is useful: # my custom settings for KWrite [General] Allow Tab Scrolling=true Auto Hide Tabs=false Close After Last=true Close documents with window=true Cycle To First Tab=true Days Meta Infos=30 Diagnostics Limit=12000 Diff Show Style=0 Elide Tab Text=false Enable Context ToolView=false Expand Tabs=false Modified Notification=false Mouse back button action=0 Mouse forward button action=0 Open New Tab To The Right Of Current=false Output With Date=false Recent File List Entry Count=10 Restore Window Configuration=true SDI Mode=false Save Meta Infos=true Show Full Path in Title=true Show Menu Bar=true Show Status Bar=true Show Symbol In Navigation Bar=true Show Tab Bar=true Show Tabs Close Button=true Show Url Nav Bar=true Show welcome view for new window=true Startup Session=manual Stash new unsaved files=true Stash unsaved file changes=false Tab Double Click New Document=true Tab Middle Click Close Document=true Tabbar Tab Limit=0 [KTextEditor Document] Allow End of Line Detection=true Auto Detect Indent=true Auto Reload If State Is In Version Control=true Auto Save=false Auto Save Interval=0 Auto Save On Focus Out=false BOM=false Backup Local=false Backup Prefix= Backup Remote=false Backup Suffix=~ Camel Cursor=true Encoding=UTF-8 End of Line=0 Indent On Backspace=true Indent On Tab=true Indent On Text Paste=true Indentation Mode=normal Indentation Width=4 Keep Extra Spaces=false Line Length Limit=10000 Newline at End of File=true On-The-Fly Spellcheck=false Overwrite Mode=false PageUp/PageDown Moves Cursor=false Remove Spaces=1 ReplaceTabsDyn=true Show Spaces=0 Show Tabs=true Smart Home=true Swap Directory= Swap File Mode=1 Swap Sync Interval=15 Tab Handling=2 Tab Width=4 Trailing Marker Size=1 Use Editor Config=true Word Wrap=false Word Wrap Column=80 [KTextEditor Renderer] Animate Bracket Matching=false Auto Color Theme Selection=false Color Theme=Funky KWrite theme Line Height Multiplier=1 Show Indentation Lines=true Show Whole Bracket Expression=false Text Font=Noto Sans Mono Medium,10,-1,5,500,0,0,0,0,0,0,0,0,0,0,1,Regular Text Font Features= Word Wrap Marker=false [KTextEditor View] Allow Mark Menu=true Auto Brackets=false Auto Center Lines=0 Auto Completion=false Auto Completion Preselect First Entry=true Backspace Remove Composed Characters=false Bookmark Menu Sorting=0 Bracket Match Preview=true Chars To Enclose Selection=<>(){}[]'" Default Mark Type=1 Dynamic Word Wrap=true Dynamic Word Wrap Align Indent=80 Dynamic Word Wrap At Static Marker=false Dynamic Word Wrap Indicators=1 Dynamic Wrap not at word boundaries=false Enable Accessibility=true Enable Tab completion=false Enter To Insert Completion=true Fold First Line=false Folding Bar=true Folding Preview=true Icon Bar=false Input Mode=0 Keyword Completion=true Line Modification=true Line Numbers=true Max Clipboard History Entries=3 Maximum Search History Size=0 Mouse Paste At Cursor Position=false Multiple Cursor Modifier=134217728 Persistent Selection=false Scroll Bar Marks=false Scroll Bar Mini Map All=true Scroll Bar Mini Map Width=60 Scroll Bar MiniMap=true Scroll Bar Preview=true Scroll Past End=true Search/Replace Flags=140 Shoe Line Ending Type in Statusbar=false Show Documentation With Completion=true Show File Encoding=true Show Folding Icons On Hover Only=true Show Line Count=false Show Scrollbars=0 Show Statusbar Dictionary=true Show Statusbar Highlighting Mode=true Show Statusbar Input Mode=true Show Statusbar Line Column=true Show Statusbar Tab Settings=true Show Word Count=false Smart Copy Cut=true Statusbar Line Column Compact Mode=true Text Drag And Drop=true User Sets Of Chars To Enclose Selection= Vi Input Mode Steal Keys=false Vi Relative Line Numbers=false Word Completion=true Word Completion Minimal Word Length=3 Word Completion Remove Tail=true [KTextEditor::Search] Replace History= Search History= [MainWindow] 1366x768 screen: Height=507 1366x768 screen: Width=814 1366x768 screen: Window-Maximized=true ToolBarsMovable=Disabled [MainWindow][Toolbar mainToolBar] IconSize=16 [UiSettings] ColorScheme=
Nice catch! Do you happen to know how that [KTextEditor::Search] section was added to your original kwriterc? I'm just checking as neither the Fedora RPM nor Flatpak versions that I have installed have that section present, so I just wanted to check before chalking things up to a local device issue :-) Thanks!
After some testing I have to admit that this was probably user error. I think I had added this section manually inside kwriterc in an effort to remove the history of searches from the "Find" field. The proper location for this segment seems to be this one instead: /home/funky/.var/app/org.kde.kwrite/.local/state/kwritestaterc Sorry for wasting your time. I'll mark this one as resolved. It would be nice to have an easy way to remove the history of searches from the "Find" field btw! Privacy and all...
(In reply to funkybomber from comment #11) > It would be nice to have an easy way to remove the history of searches from > the "Find" field btw! Privacy and all... Sounds like a good feature request - which can be submitted as a bug report here, with "wishlist" as the severity level :-)