VSCode & search+replace

I’m sure I do something wrong… this behavior can not be intended…

  • I’m doing search-and-replace in a Jupyter Notebook, by using Ctrl+F to get up the s&r window

  • I specify the text string I want to replace

  • I specify the text string I want instead in the cell below

  • I want to single-step through my document and click on the replace button

  • For some cases, I do not want to change the string.

Here is the weird behavior:

  • Every time I click on the replace button, the cursor jumps to the first occurrence of the text I have specified.
  • I want it to jump to the next occurrence!!!

Why? Suppose I want to replace “v” with “u” in my code. I have lots of “v” characters in my notebook, and I don’t want to replace characters which are parts of words – I have already stepped past these.

VSCode seems to jump to the first letter “v” in the document instead of the next letter “v”, and furthermore, doesn’t scroll to the string it is ready to replace, so I don’t even see which one it will change. Also, the color coding of occurrences of the string and which string it is ready to change is not very clear.


Question: What am I doing wrong?

VS code jumps to the next instance of the search term after the current cursor position. If you have not clicked on the file to set the position of a cursor, it assumes the cursor is at the beginning of the file.

My guess is that you are scrolling down with your mouse to the location you want to replace at, having not moved your cursor down to the region currently in view, and clicking next.

I believe if you just click somewhere in the file before the instance you want to highlight, you will get the behavior you want!

PS, since this isn’t Julia specific, I took the liberty of moving this to off topic!

1 Like

Thanks – I’ll check your suggestion.

-B