spyder-ide / spyder

Official repository for Spyder - The Scientific Python Development Environment
https://www.spyder-ide.org
MIT License
8.33k stars 1.61k forks source link

Search/Replace ignores items if already highlighted #15963

Open eafpres opened 3 years ago

eafpres commented 3 years ago

Issue Report Checklist

Problem Description

If a block of code is already highighted, entering Replace text mode will not "see" instances to replace even though they are there. However, selecting "In selection" does in fact make the requested repalcements.

What steps reproduce the problem?

  1. Here, nothing was highlighted in the code, Find text was selected, and the text "scaled_boundary" was typed. The correct items are then highlighted. image The same result is obtained if the block from line 10 to 23 is highlighted before selecting Find text--the text typed in is highlighted and the item i of n is displayed correctly

  2. Here, the block from line 10 to 23 was highlighted in the editor, then Replace text is selected, and the text "scaled_boundary" is typed in. Nothing is highlighted, it says no matches. image However, if you enter a replacement text and choose In selection, the replacements ARE made.

  3. Here, the block from line 10 to 23 was not highlighted before selecting Replace text, then when the text is typed in, the correct texts are highlighted and the item i of n is displayed correctly. image

What is the expected output? What do you see instead?

When you select Replace text with a code block highlighted, and you enter a text to find, it should still find them and display item i of n, so that you know what is going to happen next.

Paste Traceback/Error Below (if applicable)


None

Versions

Dependencies

# Mandatory:
atomicwrites >=1.2.0          :  1.4.0 (OK)
chardet >=2.0.0               :  4.0.0 (OK)
cloudpickle >=0.5.0           :  1.6.0 (OK)
cookiecutter >=1.6.0          :  1.7.3 (OK)
diff_match_patch >=20181111   :  20200713 (OK)
intervaltree >=3.0.2          :  3.1.0 (OK)
IPython >=7.6.0               :  7.24.1 (OK)
jedi =0.17.2                  :  0.17.2 (OK)
jsonschema >=3.2.0            :  3.2.0 (OK)
keyring >=17.0.0              :  23.0.1 (OK)
nbconvert >=4.0               :  6.0.7 (OK)
numpydoc >=0.6.0              :  1.1.0 (OK)
paramiko >=2.4.0              :  2.7.2 (OK)
parso =0.7.0                  :  0.7.0 (OK)
pexpect >=4.4.0               :  4.8.0 (OK)
pickleshare >=0.4             :  0.7.5 (OK)
psutil >=5.3                  :  5.8.0 (OK)
pygments >=2.0                :  2.9.0 (OK)
pylint >=1.0                  :  2.8.3 (OK)
pyls >=0.36.2;<1.0.0          :  0.36.2 (OK)
pyls_black >=0.4.6            :  0.4.7 (OK)
pyls_spyder >=0.3.2;<0.4.0    :  0.3.2 (OK)
qdarkstyle =3.0.2             :  3.0.2 (OK)
qstylizer >=0.1.10            :  0.2.0 (OK)
qtawesome >=1.0.2             :  1.0.2 (OK)
qtconsole >=5.1.0             :  5.1.0 (OK)
qtpy >=1.5.0                  :  1.9.0 (OK)
rtree >=0.9.7                 :  0.9.7 (OK)
setuptools >=39.0.0           :  56.0.0 (OK)
sphinx >=0.6.6                :  4.0.2 (OK)
spyder_kernels >=2.0.4;<2.1.0 :  2.0.4 (OK)
textdistance >=4.2.0          :  4.2.1 (OK)
three_merge >=0.1.1           :  0.1.1 (OK)
watchdog >=0.10.3             :  2.1.2 (OK)
zmq >=17                      :  22.1.0 (OK)

# Optional:
cython >=0.21                 :  0.29.23 (OK)
matplotlib >=2.0.0            :  3.4.2 (OK)
numpy >=1.7                   :  1.19.5 (OK)
pandas >=1.1.1                :  1.2.4 (OK)
scipy >=0.17.0                :  1.6.3 (OK)
sympy >=0.7.3                 :  None (NOK)
dalthviz commented 3 years ago

Hi @eafpres, sorry for the late response. thanks for the feedback, I was able to reproduce this :+1: