Fix block selection mode in a couple of cases
ClosedPublic

Authored by ahmadsamir on Jun 5 2018, 9:53 AM.

Details

Summary

Make it possible to extend the selection when selecting text in
column/block mode, by holding down Alt+Ctrl+Shift.

Commit e5b7480966f3121f4e1042648e29a74b9c29b2e9 disabled text selection
in apps running on the Alternate screen buffer, when they tell the
terminal they're interested in Mouse Tracking events, unless only the Shift
key is pressed; this accidentally prevented block selection mode from
working in that case. Tweak the condition, to also allow block selection
mode to work when Shift is pressed. Note that the selection can't be
extended in programs while Mouse Tracking events are enabled.

BUG: 331034
FIXED-IN: 18.08

Test Plan
  • Open a new tab and cat some file to have some text on the screen: a - Select text with no modifier keys pressed b - Select some text, press and hold Shift and extend the selection c - Press and hold Alt+Ctrl, to select text in block mode, and while still pressing Alt+Ctrl, press Shift and extend the selection in block mode
  • Open some file in vim, with normal mode :set mouse=, and repeat a, b, c
  • Switch to visual mode in vim :set mouse=a:
    • Hold down Shift and select text
    • Hold down Shift+Alt+Ctrl and select text in column mode
    • Note that extending the selection doesn't work in vim visual mode (i.e. after the app indicates it's interested in Mouse Tracking events)

Diff Detail

Repository
R319 Konsole
Branch
block-selection-mode (branched from master)
Lint
No Linters Available
Unit
No Unit Test Coverage
ahmadsamir created this revision.Jun 5 2018, 9:53 AM
Restricted Application added a project: Konsole. · View Herald TranscriptJun 5 2018, 9:53 AM
Restricted Application added a subscriber: konsole-devel. · View Herald Transcript
ahmadsamir requested review of this revision.Jun 5 2018, 9:53 AM
anthonyfieroni added inline comments.
src/TerminalDisplay.cpp
2267 ↗(On Diff #35597)

&& !(...)

2268 ↗(On Diff #35597)

&& (...)

ahmadsamir updated this revision to Diff 35615.Jun 5 2018, 1:05 PM

Tighten parentheses.

ahmadsamir marked 2 inline comments as done.Jun 5 2018, 1:07 PM
ahmadsamir added inline comments.
src/TerminalDisplay.cpp
2267 ↗(On Diff #35597)

Thanks, I've fixed it (I think).

ahmadsamir marked 2 inline comments as done.Jun 5 2018, 9:26 PM
hindenburg accepted this revision.Jun 6 2018, 11:50 AM
hindenburg added a subscriber: hindenburg.

Thanks

This revision is now accepted and ready to land.Jun 6 2018, 11:50 AM
This revision was automatically updated to reflect the committed changes.