Notepad2e icon indicating copy to clipboard operation
Notepad2e copied to clipboard

Ctrl+Backtick edits all occurrences

Open ProgerXP opened this issue 5 years ago • 8 comments
trafficstars

Document:

aa|
aa aa

Press Ctrl+Backtick: all 3 aa will be editing instead of none.

This doesn't occur if cursor is on the second line.

ProgerXP avatar Apr 18 '20 10:04 ProgerXP

Fixed in the latest change for #286.

cshnik avatar Apr 21 '20 16:04 cshnik

This is still not correct - editing should not even start in this case. I have checked the previous versions and indeed it used to work like now, however, there is a discrepancy between Ctrl+Backtick and Ctrl+Tab: the latter does not start editing if there is only a single region to-be edited. Ctrl+Backtick should work the same way.

Update: moreover, I found that Ctrl+Backtick currently enters edit mode if there is an occurrence elsewhere (just not on this line) and doesn't if the region is the only one in the document.

ProgerXP avatar Apr 21 '20 20:04 ProgerXP

Fixed.

cshnik avatar Apr 29 '20 16:04 cshnik

This is still not correct - editing should not even start in this case. I have checked the previous versions and indeed it used to work like now, however, there is a discrepancy between Ctrl+Backtick and Ctrl+Tab: the latter does not start editing if there is only a single region to-be edited. Ctrl+Backtick should work the same way.

aa|
aa

Ctrl+Backtick starts editing aa even though there's only 1 match on line.

ProgerXP avatar Jun 28 '20 15:06 ProgerXP

Fixed.

cshnik avatar Jul 08 '20 18:07 cshnik

This is still not correct - editing should not even start in this case. I have checked the previous versions and indeed it used to work like now, however, there is a discrepancy between Ctrl+Backtick and Ctrl+Tab: the latter does not start editing if there is only a single region to-be edited. Ctrl+Backtick should work the same way.

Why this regression is keeping to occur again and again? Please check the logic to ensure it's correct to avoid another bug-after-fix. If needed, clarify it with refactoring.

When user tries to enter Edit Mode via any means (Ctrl+Tab, Ctrl+backtick, etc.) and if there is only one edit region (e.g. document occurrence) then nothing should happen (keystroke should be ignored).

Currently, if you insert aaa into a large document in such places that only one occurrence is seen, and disable Document-Wise Edit Word then Ctrl+Tab on aaa would still enter Edit Mode, saying "Editing 1 occurrence".

That being said, there is no need for occurrence%s because of the reason above (https://github.com/ProgerXP/Notepad2e/issues/286#issuecomment-617418587).

ProgerXP avatar Sep 01 '21 19:09 ProgerXP

This is still not correct

Seems to have been fixed meanwhile.

ProgerXP avatar Aug 01 '22 18:08 ProgerXP

Seems to have been fixed meanwhile.

No way, it's appearing again in 360e461: Ctrl+Tab happily enters edit mode on a document with aa on the first line and on the last line (beyond scrolling), saying Editing 1 occurrence (visible only).

ProgerXP avatar Sep 26 '22 15:09 ProgerXP

Fixed.

cshnik avatar Nov 15 '22 15:11 cshnik