Skip to content
  • Daniel Boles's avatar
    Entry: Fix Shift-click → extend/truncate selection · 12d96f27
    Daniel Boles authored and Daniel Boles's avatar Daniel Boles committed
    Since the move from button-press to gesture events, Shift-clicking did
    not work to start a selection (from none) or truncate an existing one.
    
    This was due to the code being copy-pasted around and some logic being
    broken in the process. This makes both of those work as they should, by
    shuffling it again so the end result is the same as before. Highlights:
    
    (1) ::button-press if extending due to a single press would call
    set_positions(tmp_pos, tmp_pos), which is what made the Shift+click to
    create a selection work. That was lost. Add it back to make that work.
    
    (2) ::button-press in the “Truncate current selection” branch would not
    execute all the stuff around “extend_to_left”, as that was the else
    case. So, set extend_selection = FALSE so we skip over that later on.
    
    (3) BUT! This Truncate case never fired because it was in the else
    branch of if (in_selection())! Of course, it must be in the true branch.
    
    (4) The IM context was not reset if the Shift-click occurred within an
    existing selection, only if it did not. In ::button-press this was the
    first thing done if extending a selection, regardless. Make it so again.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=780750
    12d96f27