texstudio icon indicating copy to clipboard operation
texstudio copied to clipboard

Only search in the selected text" toggle button has no real effect

Open SiloKrisz opened this issue 1 year ago • 0 comments

Environment

  • TeXstudio: 4.5.2 (git 4.5.2)
  • Qt: Version 6.5.0, compiled with Qt 6.5.0 R
  • OS: Windows 10 Enterprise
  • TeX distribution: miktex

Expected behavior

"Update Search" button really updates the search results according to the actual settings for the search.

Actual behavior

"Update Search" button does not updates the searches according to the settings, some weird behavior for the "Only search in the selected text" toggle button.

How to reproduce

Create the following input:

\newcommand{\mya}{hello} \newcommand{\myb}{hello} \newcommand{\myc}{hello} \newcommand{\myd}{hello}

Then try to search and replace the "}{" in only the middle lines (i.e. for "myb" and "myc"), with the following: 0) Select the two middle lines

  1. Enter the term "}{" into the search bar
  2. Set "Highlight search matches..." toggle button
  3. Set "Only search in the selected text" toggle button
  4. Click on "Extended search" button ==> All the lines will be selected, however the only the previously selected one should be in the results.
  5. Use Current Doc for the searches.
  6. Click "Update Search" button ==> No change, all the lines are selected
  7. Try toggle "Only search in the selected text" off - on and then try "Update Search" button ==> No change, all the lines are selected. Sometimes it can be done that in the editor the two middle lines are shown as selected, however in the search window always all the lines are selected like:

TextStudio - Screenshot 2023-07-19 174515

so using replacing in this state, still replaces all the results, and disregards the "Only search in the selected text".

Thank you, Krisz

SiloKrisz avatar Jul 19 '23 15:07 SiloKrisz