Bug 450414 - 'Search and Replace' & 'Find' discrepancies (search and replace has no X button and doesn't automatically paste highlighted text)
Summary: 'Search and Replace' & 'Find' discrepancies (search and replace has no X butt...
Status: RESOLVED NOT A BUG
Alias: None
Product: kate
Classification: Applications
Component: application (show other bugs)
Version: 21.12.2
Platform: Neon Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-02-16 22:27 UTC by jimbo
Modified: 2022-02-17 18:03 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Video (3.38 MB, video/mp4)
2022-02-17 13:56 UTC, Waqar Ahmed
Details
SearchAndReplaceIssue (61.49 KB, video/mp4)
2022-02-17 14:07 UTC, jimbo
Details
It won't close the same as you can close (162.42 KB, video/mp4)
2022-02-17 14:41 UTC, jimbo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jimbo 2022-02-16 22:27:39 UTC
When using the Find function in Kate, it acts as expected. Highlight the word you want to find, hit [Ctrl+F] and the word will automatically populate in the find input field. There is a nice red X to the top right to close the function when you are finished or you can hit [Esc] to exit.

Search and Replace is different. Highlighting the word and calling the function (in my case [Ctrl+R]) will not auto populate the find input field. There is no red X to exit (also [Esc] doesn't exit), instead there is a resizable handle in the middle. If you drag that to the bottom to 'close' the panel it doesn't close. You either have to hit the hotkey again or go through the menu View -> Toolbars -> Search and Replace.

It would be nice if these two functions had consistency between them. Thanks.
Comment 1 Waqar Ahmed 2022-02-17 05:37:12 UTC
> There is no red X to exit 

By design, since S&R is a persistent toolview and this is consistent with all other toolviews (project, LSP, Terminal)

> (also [Esc] doesn't exit)

It won't exit on first press if you have a "search in progress". First 'Esc' press will remove the search highglightings, second will close the toolview.

> instead there is a resizable handle in the middle. If you drag that to the bottom to 'close' the panel it doesn't close

You need to drag the handle down and keep dragging towards the bottom till you reach the end, then it will close. The reason its like this is because otherwise its hard to tell whether you were resizing or wanted to close the toolview.
Comment 2 jimbo 2022-02-17 13:28:43 UTC
(In reply to Waqar Ahmed from comment #1)
> By design, since S&R is a persistent toolview and this is consistent with
> all other toolviews (project, LSP, Terminal)

Maybe this shouldn't be consistent with those other tools because it is frequently called upon and it's similar to 'Find' which you haven't addressed.
Comment 3 jimbo 2022-02-17 13:40:50 UTC
> It won't exit on first press if you have a "search in progress". First 'Esc'
> press will remove the search highglightings, second will close the toolview.

You have to define what a "search in progress" is. If I call up Search and Replace, is that a "search in progress"? I don't think so, until I type something into the input field, then it's a "search in progress", otherwise it should be cancelled by a simple 'Esc' the same way that Find works. Double 'Esc' to me is fine if I've entered something.
Comment 4 Waqar Ahmed 2022-02-17 13:42:30 UTC
> Maybe this shouldn't be consistent with those other tools because it is frequently called upon and it's similar to 'Find' which you haven't addressed.

Depends on the user what will be frequent. For me, "project" or "lsp" toolview is more frequent, search a lot less. Consistency between toolviews is more important than between the two searches because we want 1 way to close all the toolviews at the bottom.

> Search and Replace is different. Highlighting the word and calling the function (in my case [Ctrl+R]) will not auto populate the find input field. 

Hmm, missed this one. Trying it here using default shortcut (Ctrl + Shift + F) with a selection the input field is highlighted. Maybe you are talking about the Power search mode, which is activated using `Ctrl + R` (default shortcut), yes, that doesn't seem to put the word under cursor in the "Find" field, no reason that I can think of, should be fixed I think.

That makes me think that maybe you were not talking about the Search&Replace plugin at all.
Comment 5 jimbo 2022-02-17 13:48:45 UTC
(In reply to Waqar Ahmed from comment #1)
> You need to drag the handle down and keep dragging towards the bottom till
> you reach the end, then it will close. The reason its like this is because
> otherwise its hard to tell whether you were resizing or wanted to close the
> toolview.

I've tried this and what you have said is incorrect. The panel never 'closes' it always stays there. I don't understand what you mean when you explain the reasoning. The only way to close that panel properly is what I had said in my original submission. 

"If you drag that to the bottom to 'close' the panel it doesn't close. You either have to hit the hotkey again or go through the menu View -> Toolbars -> Search and Replace."

Are you saying that you cannot reproduce this on your end?
Comment 6 jimbo 2022-02-17 13:54:01 UTC
(In reply to Waqar Ahmed from comment #4)
> > Maybe this shouldn't be consistent with those other tools because it is frequently called upon and it's similar to 'Find' which you haven't addressed.
> 
> Depends on the user what will be frequent. For me, "project" or "lsp"
> toolview is more frequent, search a lot less. Consistency between toolviews
> is more important than between the two searches because we want 1 way to
> close all the toolviews at the bottom.
> 
> > Search and Replace is different. Highlighting the word and calling the function (in my case [Ctrl+R]) will not auto populate the find input field. 
> 
> Hmm, missed this one. Trying it here using default shortcut (Ctrl + Shift +
> F) with a selection the input field is highlighted. Maybe you are talking
> about the Power search mode, which is activated using `Ctrl + R` (default
> shortcut), yes, that doesn't seem to put the word under cursor in the "Find"
> field, no reason that I can think of, should be fixed I think.
> 
> That makes me think that maybe you were not talking about the Search&Replace
> plugin at all.

In my original post, I said "(in my case [Ctrl+R])" which meant that I had changed the shortcut. I'm sorry that you didn't pick up on that. You are mistaken if you think that I'm not talking about 'Search and Replace'. I can point to the title of this thread which is "Search and Replace' & 'Find' discrepancies". Please re-read the thread before jumping to conclusions.
Comment 7 Waqar Ahmed 2022-02-17 13:54:38 UTC
Attaching a video recording of what I am doing. Maybe after seeing that you can tell what is it that you are doing differently which results in unexpected behaviour.

Also, notice that on first Esc press, the checkboxes are unchecked, and on second the toolview hides.
Comment 8 Waqar Ahmed 2022-02-17 13:56:09 UTC
Created attachment 146867 [details]
Video
Comment 9 Waqar Ahmed 2022-02-17 13:59:09 UTC
> Please re-read the thread before jumping to conclusions.

1. Not jumping to any conclusions. *Re-read the words I wrote*
2. Many people confuse the two and it leads to confusing bug reports.
Comment 10 jimbo 2022-02-17 14:07:51 UTC
Created attachment 146868 [details]
SearchAndReplaceIssue

This is my experience with search and replace, Kate version 21.12.1
Comment 11 jimbo 2022-02-17 14:14:15 UTC
(In reply to Waqar Ahmed from comment #9)
> > Please re-read the thread before jumping to conclusions.
> 
> 1. Not jumping to any conclusions. *Re-read the words I wrote*
> 2. Many people confuse the two and it leads to confusing bug reports.

Alright... ok, I hate communicating via text, possibly the worst form of communication ever. However, I think there is an issue with us having different experiences with the same program. I'm not sure what's wrong, but it is with Search and Replace.
Comment 12 Waqar Ahmed 2022-02-17 14:19:00 UTC
Hmm, ok I see. If you open it via menu, then it doesn't put the word under cursor in the input line. But if you try with the shortcut it will select the word under cursor.

Not sure if this should be fixed or not. The problem with fixing it will be that if you start a search for a word "abc", then hide the toolview and then put your cursor elsewhere and show the toolview again because you want to see the previous results, it will overwrite the previous search. With the simple Ctrl + F find, that is not a problem as there is no previous result to see.
Comment 13 Waqar Ahmed 2022-02-17 14:20:27 UTC
Also, to make it clear, the shortcut that selects the word under cursor is "Search in Files".
Comment 14 jimbo 2022-02-17 14:41:48 UTC
Created attachment 146869 [details]
It won't close the same as you can close
Comment 15 Waqar Ahmed 2022-02-17 15:37:44 UTC
Maybe I am misunderstanding, but in the video I see that when you drag it down, it hides. Is it not what you are expecting?
Comment 16 Kåre Särs 2022-02-17 17:38:42 UTC
@jumbo
1) Please use the "Edit -> Search in Files" action in stead. The "View -> Tool Views... -> Show ..." actions are there just to open close the tool views with no extra functionality.

2) Pressing ESC will remove the highlighting (if you have search matches), otherwise it will close the tool-view (Note: different than collapsing) -> Two ESC presses will always close the search tool-view.

@Waqar
3)  Wonder if we should investigate disabling the collapsing of the tool-views altogether... It only brings confusion when people collapse it and then can't find their tool-views...
Comment 17 Kåre Särs 2022-02-17 17:44:53 UTC
It was meant to read @jimbo,  Sorry for the typo :(
Comment 18 Christoph Cullmann 2022-02-17 18:03:31 UTC
> @Waqar
> 3)  Wonder if we should investigate disabling the collapsing of the
> tool-views altogether... It only brings confusion when people collapse it
> and then can't find their tool-views...

For me, even if I collapse them, they will pop up again either by clicking the toolview button or e.g. starting a new search via pgrep.
I think that works perfectly fine.
But perhaps I miss to see the issue.