Window can be resized with an "offset_pos" flag, which means that
the resize took place on the top left corner of the window, leading
to a change in current window position. This is treated as temporary
and the position change is stored in a m_position_offset field.
That allows the ncurses UI to offset the position when it displays
a Search menu, so that the window does not constantly scroll when
the search menu open/closes. The window will only scroll if it needs
to in order to keep the main selectin visible.
Add a UserInterface::is_ok method and return false on
SIGHUP/stdin closing/socket dropping
This should be cleaner and more robust than the previous SIGHUP
handling code.
Fixes#1594
Shifted function keys are not well standardized around terminals,
Shift F(N) usually returns F(X) + N, with X=12 on xterm, X=10 on
rxvt-unicode... Default to X=12 and make it configuable through
the ncurses_shift_function_key ui_option.
This fixes what #1898 tried to.
Because keyboard layouts vary, the shift-modifier `<s-…>` is only supported
for special keys (like `<up>` and `<home>`) and for ASCII lowercase where
we assume the shift-modifier just produces the matching uppercase character.
Even that's not universally true, since in Turkish `i` and `I` are not an
uppercase/lowercase pair, but Kakoune's default keyboard mappings already
assume en-US mappings for mnemonic purposes.
Mappings of the form `<s-x>` are normalized to `<X>` when `x` is an ASCII
character. `<backtab>` is removed, since we can now say `<s-tab>`.
reset the mouse state so that the terminal can take back control
of the mouse while Kakoune is suspended, and does not emit focus
events anymore.
Fixes#1816
We were generating a string, then splitting it into lines, there is
no need for that, we can directly generate a vector of lines and
simplify the code.
The solution is a bit hackish, as we only consider the 8th bit to
mean alt in normal mode, because its unlikely accentuated characters
are going to be mapped there. It fixes using Alt on xterm, and
probably on iterm2 as well (not requiring the meta-sends-esc config
change anymore)