Bug 429091 - Make it easier to switch search folder to current file
Summary: Make it easier to switch search folder to current file
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: search (show other bugs)
Version: 20.08.3
Platform: Arch Linux Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-11-14 13:21 UTC by Podagric
Modified: 2020-11-20 20:53 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Podagric 2020-11-14 13:21:34 UTC
SUMMARY
If you have two tabs open in Kate and both files are from different folders, kate does not change the folder where the search will be done.

STEPS TO REPRODUCE
1. Open two files in the kate, both from different folders
2. In the search tool, use the option "In folder" and type something so that it finds
3. When you switch to the other tab, with the other file, and do the search again, the kate will fetch in the folder of the previous file, and not in the one of the current file

For the search to be done in the correct folder, it is necessary to change the location of the search to another option and then return to the folder again, so it will search in the correct location.

I tried to show it in this video:
https://upload.vaa.red/FDdyV#5mFiX0lIKG1G6QJamrNUQu2t4RRWf0PQ


SOFTWARE/OS VERSIONS
Operating System: Arch Linux
KDE Plasma Version: 5.20.3
KDE Frameworks Version: 5.75.0
Qt Version: 5.15.1
Kernel Version: 5.9.8-arch1-1
OS Type: 64-bit
Comment 1 Kåre Särs 2020-11-14 14:43:12 UTC
Thanks for the report!

This is currently working as designed. The reason for not changing the folder with  the changed document is that if you work in a little bit bigger project you have multiple folders and most of the time you want to search in the whole project and not only in the current file's directory. 

If you want to switch the search folder to the current files folder, there is the "reload" button on the right of the folder selector that loads the current files directory. 

This button is a bit badly placed as you need to open the "folder options" to be able to click it. At one point I had moved it to just under the search place combo... I think the reason it was moved back to it's current place was that it functionally fits better with the other buttons on the row in the "folder options"

If you think the button should be moved back to just under the combo please reopen the bug report as a wish.

Thanks,
  Kåre
Comment 2 Podagric 2020-11-14 16:30:44 UTC
for the button to update the folder to be displayed, it is also necessary to change the location where the search will be made. so the location it is currently in does not solve the problem I mentioned because the same task of changing the folder location is still necessary.
Comment 3 Kåre Särs 2020-11-14 20:59:12 UTC
Actually you do not need to change the search location, but you need to click on the "show search options" button to the left of the replace input to open the folder search options...

That said you need to move the mouse all the way to the left click a button and then move all the way back to the right to be able to click the "reload" button. not a good UX :(
Comment 4 Podagric 2020-11-14 22:22:45 UTC
yes, they are two ways of doing the same thing. neither of them is good enough.
That's why the bug should remain open, someone could look at it and try to improve.
Comment 5 Kåre Särs 2020-11-15 07:29:03 UTC
OK, I restated the summary and reopened the bug/wish.

My suggested fix is to move the button back up so that we do not need to open the extended options.
Comment 6 Podagric 2020-11-15 13:33:13 UTC
thanks
Comment 7 Kåre Särs 2020-11-20 20:53:27 UTC
Git commit 6b759fbc0782583b31140f74ab78e1ebb17ed505 by Kåre Särs.
Committed on 20/11/2020 at 20:52.
Pushed by sars into branch 'master'.

S&R: Move the current-folder button to the main options

Replace the find/replace labels with placeholders
Move the current-folder button next to searchPlacesCombo
Move the new-tab and more search-options to the right of the second row
Vertical layout difference is search&replace combos on separate rows
Fix tab navigation

M  +80   -51   addons/search/plugin_search.cpp
M  +1    -1    addons/search/plugin_search.h
M  +171  -155  addons/search/search.ui

https://invent.kde.org/utilities/kate/commit/6b759fbc0782583b31140f74ab78e1ebb17ed505