mirror of
git://git.sv.gnu.org/nano.git
synced 2024-11-29 16:13:27 +03:00
replacing: compensate cursor position only for replacements /before/ it
When a replacement happens right at where the cursor sits, the position of the cursor should not be adjusted, because the real cursor position is between the current character and the preceding one: the place where the cursor is shown is in fact right /after/ the insertion point. This fixes https://savannah.gnu.org/bugs/?50134, and fixes https://savannah.gnu.org/bugs/?50135.
This commit is contained in:
parent
a8a70f0f29
commit
3534d8ff25
@ -710,7 +710,7 @@ ssize_t do_replace_loop(const char *needle, bool whole_word_only,
|
|||||||
if (!old_mark_set || right_side_up) {
|
if (!old_mark_set || right_side_up) {
|
||||||
#endif
|
#endif
|
||||||
if (openfile->current == real_current &&
|
if (openfile->current == real_current &&
|
||||||
openfile->current_x <= *real_current_x) {
|
openfile->current_x < *real_current_x) {
|
||||||
if (*real_current_x < openfile->current_x + match_len)
|
if (*real_current_x < openfile->current_x + match_len)
|
||||||
*real_current_x = openfile->current_x + match_len;
|
*real_current_x = openfile->current_x + match_len;
|
||||||
*real_current_x += length_change;
|
*real_current_x += length_change;
|
||||||
|
Loading…
Reference in New Issue
Block a user