Skip to content

Intuitive movements between split views

Hello,

As the title says this merge request implements intuitive movements between split views.

That is, four new actions: left split view, right split view, upward split view, and downward split view. These do what you can imagine they do, and do so intuitively, using the cursor position when necessary to solve ambiguities.

Imagine the following split view layout:

 ______________________________________
|1                 |2                  |
|                  |                   |
|        a         |    c        d     |
|                  |                   |
|                  |___________________|
|                  |3        |4        |
|                  |         |         |
|        b         |         |         |
|                  |         |         |
|__________________|_________|_________|

In this situation:

  • if I'm in split view 1 at point a and call "go right" it will activate split view 2;
  • if I'm in split view 1 at point b and call "go right" it will activate split view 3;
  • if I'm in split view 2 and call "go left" it will activate split view 1;
  • if I'm in split view 2 at point c and call "go down" it will activate split view 3;
  • if I'm in split view 2 at point d and call "go down" it will activate split view 4;
  • if I'm in split view 3 and call "go up" it will activate split view 2;
  • if I'm in split view 3 and call "go left" it will activate split view 1;
  • if I'm in split view 3 and call "go right" it will activate split view 4;
  • if I'm in split view 4 and call "go up" it will activate split view 2;
  • if I'm in split view 4 and call "go left" it will activate split view 3.

In this situation this is all, because I didn't implement wrap around as I would find this counter-intuitive in case of mistyping, and counter-intuitive is the opposite of what I'm going for here (meaning that for example here in split view 1, going left, up, or down, just does nothing).

Demo video: https://youtu.be/eoEpo37p3wM (the layout in the video makes no sense but allows to demo the new features ^^)

I suggest Alt+arrows for the shortcuts, but I commented out the lines that set these default shortcuts because right now they are taken by other things: Alt+Left and Alt+Right are taken by the tab bar (I personally don't use it at all — not the shortcut, the tab bar ^^); Alt+Up and Alt+Down are take by the filetree plugin for "next document" and "previous document". All other combinations of modifiers + arrows are also taken and much more standard (like ctrl+shift+left is "select previous word" which is logical given what shift+left does (select previous char) and what ctrl+left does (move one word backward)).


I also added a commit which renames KateViewSpace::viewManger() into KateViewSpace::viewManager() as I suppose this was a mistake which persisted thanks to autocompletion ^^.

Edited by Pablo Rauzy

Merge request reports