Ticket #2437 (closed defect: fixed)

Opened 14 years ago

Last modified 14 years ago

mcedit text selection length doesn't change when text is deleted

Reported by: jimklimov Owned by: angel_il
Priority: minor Milestone: 4.7.5
Component: mcedit Version: 4.7.4
Keywords: Cc: gotar@…
Blocked By: Blocking:
Branch state: Votes for changeset: commited-master

Description

When some text is selected in MCEDIT (via ESC+3 and arrow keys and selection is fixed by pressing ESC+3 again), and then some of the selection text is removed by backspace key only, and then the text is subsequently saved (ESC+2), the end of selection "moves forward" by the amount of characters removed by backspace.

This is best seen when several whole lines are initially selected, and some characters are removed in the middle of selection. After saving the file, end of selection becomes a few characters into the next line after old end of selection.

This does not happen when selection characters removed by DEL or Ctrl+D keys, nor when whole lines are removed by Ctrl+Y.

This does not happen when characters are added inside the selection.

This does happen when some characters are backspaced away and the same amount of characters is typed inside the selection.

Occurence by versions:

  • tested positive in 4.7.4, 4.7.0.10;
  • tested negative in old 4.6.1

Change History

comment:2 in reply to: ↑ 1 Changed 14 years ago by angel_il

steps to reproduce
text

11111
22222
33333
44444
55555


1) switch on Persistent selection ([х] Persistent selection)
2) select text from 2 to 4 lines
3) move cursor into end of line №3
4) delete 3 chars with backspace
5) move cursor into line 5

comment:3 Changed 14 years ago by angel_il

  • Owner set to angel_il
  • Status changed from new to accepted
  • severity changed from no branch to on review
  • Milestone changed from 4.8 to 4.7.5

branch: 2437_editor_selection_length_fix
changeset: 951eb0882d943fe70027d307918be9810fb9470f

please review

comment:4 Changed 14 years ago by andrew_b

  • Votes for changeset set to andrew_b

comment:5 follow-up: ↓ 7 Changed 14 years ago by gotar

  • Cc gotar@… added

See also #2394.

comment:6 Changed 14 years ago by jimklimov

+1
fixes the problem for 4.7.0.10-based source

comment:7 in reply to: ↑ 5 Changed 14 years ago by andrew_b

Replying to gotar:

See also #2394.

What do you mean? Does this fix also fixes #2394 fully or partially?

comment:8 Changed 14 years ago by slavazanko

  • Votes for changeset changed from andrew_b to andrew_b slavazanko
  • severity changed from on review to approved

comment:9 Changed 14 years ago by slavazanko

  • Status changed from accepted to testing
  • Votes for changeset changed from andrew_b slavazanko to commited-master
  • Resolution set to fixed
  • severity changed from approved to merged

comment:10 Changed 14 years ago by slavazanko

  • Status changed from testing to closed

comment:11 Changed 14 years ago by andrew_b

Cherry-picked into 4.7.0-stable.
changeset:ef6aa67e65d2d9cc628eafbd47a476ecc88a53a0

Note: See TracTickets for help on using tickets.