You are here: PSPad forum > Bug report / Hlášení chyb > Re: Search & replace doesn't find match at cursor
Posted by: tertius | Date: 2021-01-06 19:30 | IP: IP Logged
There is a small nuisance with search & replace with the first match, if you selected text to pre-fill the search field. No bug, but perhaps behavior can be improved.
- Activate the prefilling of the search field (settings->tools->search - fill in search field with selected/current text
If you search or search/replace with that option, the search field is filled with the word under the cursor, or with the selected text. If you actually start replacing, the word under the cursor is found only, if the cursor is at the beginning of the word or the selected text. If the cursor is in the middle of the word, replacing starts with the next found word, not with the word under the cursor.
I find this a bit of a nuisance. Usually, the first item I want to replace is skipped this way, and I have to replace the first occurrence extra.
I want Pspad should find the word under the cursor as well - regardless of being at the start or at the middle.
Search seems to always start at current cursor location. If the above option is active, search should start with the beginning of the current word/selected text and not with the current cursor location. If left of the cursor is not a whitespace, search for the next whitespace left to the cursor and let the search begin at that location, not at the current cursor location. Maximum backtrack should be the length of the search expression, otherwise matches could be included that are too far to the left of the current cursor location.
Posted by: pspad | Date: 2021-01-07 12:17 | IP: IP Logged
You replace from the cursor position to the end of file or to the begin of the file or in whole text
Option depends of your choice. If cursor is behind the word, replace will start in next occurence.