community icon indicating copy to clipboard operation
community copied to clipboard

Fixed TextInput._shift_lines

Open Alspb opened this issue 4 years ago • 0 comments

Fixed TextInput._shift_lines doesn't work for the following case (and many others): Shift_lines (Alt + Up does nothing)

Note that _shift_lines now swaps two paragraphs (or more precisely, moves selected set of paragraphs up or down), not just lines sets. From the source code in seems that in was designed to do so, but haven't found any documentation. Anyway, swapping lines inside one paragraph looks strange.

Also the patch fixes on_triple_tap. E.g. below when tapping on the second line, first is selected. Triple_tap_bug

But now on_triple_tap also selects the paragraph! And it also seems that _expand_range (called in on_triple_tap) was designed to act that way. In my opinion that this option is better than selecting one line only, but it's a matter of taste. Anyway, user can easily override on_triple_tap.

Maintainer merge checklist

  • [ ] Title is descriptive/clear for inclusion in release notes.
  • [ ] Applied a Component: xxx label.
  • [ ] Applied the api-deprecation or api-break label.
  • [ ] Applied the release-highlight label to be highlighted in release notes.
  • [ ] Added to the milestone version it was merged into.
  • [ ] Unittests are included in PR.
  • [ ] Properly documented, including versionadded, versionchanged as needed.

Alspb avatar Sep 25 '21 11:09 Alspb