| Commit message (Collapse) | Author | Age |
| |
|
|
|
|
|
| |
vim-patch:8.2.0559: clearing a struct is verbose
Problem: Clearing a struct is verbose.
Solution: Define and use CLEAR_FIELD() and CLEAR_POINTER().
https://github.com/vim/vim/commit/a80faa8930ed5a554beeb2727762538873135e83
|
| |
|
| |
Note: This only applies to ambiguous-width characters.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem
-------
In #19040, I reported two things that started happening somewhen in the
last three months when using neovim in hterm (the Chrome Secure Shell
terminal):
1. Under certain circumstances, the window title (set by nvim
[i0]) would appear over the line I was typing, corrupting the screen.
2. If I changed my $TERM from xterm-256color to the new hterm-256color
(available since ncurses >=20210320), the window title corruption
was gone, but pane scrolling was broken.
Both problems are due to changes in the termcap files, their source of
truth being the ncurses project. See "Timeline of ncurses changes" below
for details.
Cause: title corruption
-----------------------
The title corruption when using hterm + TERM=xterm-256color can be
explained by event #4 (ncurses 2022-03-12) in the ncurses timeline:
The xterm-256color termcap file gained status line termcodes in ncurses
2022-03-12. These termcodes are used by Neovim to set the title when.
hterm does not have a status line. Due to ncurses versions earlier than
2022-03-12 missing the xterm status line capability, Neovim manually
fixed up [t0] the terminfo file if $TERM was xterm-256color. So if
before Neovim manually added fsl/tsl capabilties, and after they were
in the termcap file, why did hterm suddenly start getting corruption?
The answer is that the termcodes for these capabilties are different
when Neovim fixes them up, versus the one in the new termcap database:
fsl=\E[0$} // from xterm-256color
tsl=\E[2$~\E[1$}\E[%i%p1%d` // from xterm-256color
fsl=\x07 // patched by Neovim
tsl=\x1b]0; // patched by Neovim
hterm ignores the latter, but corrupts the screen with the former.
Solution: Make hterm users set hterm-256color, which lacks the new
fsl/tsl codes. Also, to reduce superfluous work, stop patching in this
capability when hterm is detected (even if hterm would ignore the
patched version).
Cause: pane corruption
----------------------
The pane corruption when using hterm + TERM=hterm-256color, but NOT when
using hterm + TERM=xterm-256color can be explained by:
- Neovim uses DECSLRM when available [p1] for performant scrolling.
- Both the hterm-256color and xterm-256color termcap databases
advertise support for DECSLRM (ncurses timeline #1, #2 and #3).
- hterm does not support DESCLRM [p2] (note: it does support DESCTBM for
top/bottom scrolling, but it's broken [p3] and not used by Neovim)
- xterm-alikes that are not real xterm generally don't support DECSLRM
either, so Neovim patches it out [p4].
When using hterm-256color, hterm is no longer considered an xterm-alike
by Neovim. As a result, DECSLRM is not cleared. hterm does not support
it, so corruption ensues.
This is a problem with the hterm-256color termcap file, but we're stuck
with it so the best we can do is patch over it.
Timeline of ncurses changes
---------------------------
1. 2019-05-19: Part of the DECSLRM capability (smglr AKA set_lr_margin)
added to vt420+lrmm, which xterm-256color inherits [n1]
2. 2021-03-20: hterm-256color added, inheriting xterm-256colors. [n2]
3. 2021-09-25: The *parm versions of smglr (AKA set_lr_margin) were
added to vt420+lrmm [n3]. Namely:
1. smglp AKA set_left_margin_parm, and
2. smgrp AKA set_right_margin_parm
4. 2022-03-12: (new) codes for fsl, bsl and tsl added to xterm (add
dec+sl to xterm-new, per patch #371 -TD) [n4]
Fixes #19040.
[i0]: https://github.com/neovim/neovim/blob/3a4fa22badc5595afc0a994ead965ff32ccf6c76/src/nvim/tui/tui.c#L1377
[t0]: https://github.com/neovim/neovim/blob/3a4fa22badc5595afc0a994ead965ff32ccf6c76/src/nvim/tui/tui.c#L1728,L1729
[p1]: https://github.com/neovim/neovim/blob/3a4fa22badc5595afc0a994ead965ff32ccf6c76/src/nvim/tui/tui.c#L1196
[p2]: https://bugs.chromium.org/p/chromium/issues/detail?id=1175065&q=component%3APlatform%3EApps%3EDefault%3EHterm
[p3]: https://bugs.chromium.org/p/chromium/issues/detail?id=1298796&q=component%3APlatform%3EApps%3EDefault%3EHterm
[p4]: https://github.com/neovim/neovim/blob/3a4fa22badc5595afc0a994ead965ff32ccf6c76/src/nvim/tui/tui.c#L1740-L1752
[n1]: https://github.com/mirror/ncurses/commit/8f6d94b8d6211a2323caef53fa4c96c475ec9a6#diff-01544c577762d3308a1d232aa7afc79acf64b9a5057f88a004df82fda89549b7R2742
[n2]: https://github.com/mirror/ncurses/commit/c2650100f80134924eda8f22cd7cc1d1d919ee3d#diff-01544c577762d3308a1d232aa7afc79acf64b9a5057f88a004df82fda89549b7R5907
[n3]: https://github.com/mirror/ncurses/commit/f6b436c4fb50275df43ea10ba9c744fe195a327d#diff-01544c577762d3308a1d232aa7afc79acf64b9a5057f88a004df82fda89549b7R2842
[n4]: https://github.com/mirror/ncurses/commit/8bf8c836fe2c28238adbd62e71f03272efe155ad#diff-01544c577762d3308a1d232aa7afc79acf64b9a5057f88a004df82fda89549b7R4828
Signed-off-by: Nicolas Hillegeer <nicolas@hillegeer.com>
|
| | |
|
| |\
| |
| | |
feat(tui): recognize keypad keys when using kitty keyboard protocol
|
| | | |
|
| |/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* fix(test): screen.lua nil index
When actual_rows and expected_rows are different avoid a nil index.
* fix(tui): resize at startup
The deleted code is not needed after 402b4e8.
It caused the condition to false positive when the function was called
more than once before startup (first normal mode). Being itself what
set the dimension and not the user, locking the size of the screen to
an incorrect size.
Make got_winch an int to mitigate: tui_grid_resize changing the size
of the host terminal between the signal handler and the call to
sigwinch_cb. Since the actual signal handler uv__signal_handle doesn't
directly call the callback, the event loop does.
Fixes #17285
Fixes #15044
Fixes #11330
|
| |
|
|
|
|
| |
libuv does not call callback functions(uv_signal_cb) directly from signal
handlers. Therefore, there is no need to use volatile.
Ref. https://github.com/libuv/libuv/blob/1a91b51976a1adc6972081faa78b6b70022254d3/src/unix/signal.c#L183
|
| |
|
|
|
|
|
|
|
| |
Ref: https://github.com/vim/vim/commit/84f546363068e4ddfe14a8a2a2322bb8d3a25417
Rename:
- `underlineline` to `underdouble`
- `underdot` to `underdotted`
- `underdash` to `underdashed`
`underdouble` also now takes higher precedence than `undercurl`.
|
| |
|
|
|
|
|
|
|
| |
drawback: tracing memory errors with ASAN is less accurate for arena
allocated memory.
Therefore, to start with it is being used for Object types around
serialization/deserialization exclusively. This is going to have
a large impact especially when TUI is refactored as a co-prosess
as all UI events will be serialized and deserialized by nvim itself.
|
| | |
|
| | |
|
| |
|
|
|
|
| |
Removes NOLINT, which is pointless for the generated terminfo_defs.h.
Adds `uncrustify:off`, so it is not uncrustify which complains about the same
things (too long lines, no space after comma) instead.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Add space around arithmetic operators '+' and '-'.
Remove space between back-to-back parentheses, i.e. ')(' vs. ') ('.
Remove space between '((' or '))' of control statements.
Add space between ')' and '{' of control statements.
Remove space between function name and '(' on function declaration.
Collapse empty blocks between '{' and '}'.
Remove newline at the end of the file.
Remove newline between 'enum' and '{'.
Remove newline between '}' and ')' in a function invocation.
Remove newline between '}' and 'while' of 'do' statement.
|
| | |
|
| |
|
|
|
|
| |
On startup query the terminal for CSI u support and enable it using
the escape sequence from kitty's progressive enhancement protocol [1].
[1]: https://sw.kovidgoyal.net/kitty/keyboard-protocol/
|
| |\
| |
| | |
feat(api): allow remote UI to set terminal options
|
| | | |
|
| |/
|
|
| |
* Use the Eneks and Dseks terminfo attributes if they exist
* Add VTE versions below 0.54.0 to the blacklist
|
| |
|
|
|
|
|
|
|
|
| |
This make Nvim recognize `ESC NUL` as <M-C-Space>, as many terminal
emulators (including libvterm) send <M-C-Space> as `ESC NUL`.
There is already another unambiguous way to encode a `ESC` key supported
by libtermkey: `ESC [ 2 7 u`, which is a `CSI u` sequence.
If one still wants to use `ESC NUL` as `ESC`, they can just map
<M-C-Space> to <Esc>.
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
Follow up to #17771. The sequence `CSI > 4 ; 1 m` does not enable
distinguishing all available keys; notably, it excludes `<Tab>`. Using
`CSI > 4 ; 2 m` tells the terminal to disambiguate *all* keys, which is
much more useful.
The meaning of the final parameter is documented [here][1].
[1]: https://invisible-island.net/xterm/manpage/xterm.html#VT100-Widget-Resources:modifyOtherKeys
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On TUI startup write the CSI sequence that signals to the controlling
terminal that Neovim supports the CSI u scheme for encoding modifiers
documented in [1].
This is similar to, but distinct from, Vim's usage of the `t_TI` and
`t_TE` variables to handle Xterm's `modifyOtherKeys` setting. For a
longer explanation on those differences see [2]. Since Neovim uses
libtermkey for key input handling, we use the CSI u encoding rather than
Xterm's modifyOtherKeys encoding.
[1]: http://www.leonerd.org.uk/hacks/fixterms/
[2]: https://invisible-island.net/xterm/modified-keys.html
|
| |
|
|
|
| |
When pasting, all of key buffer can be consumed, and in case of phase 3
the paste event must be put exactly once, so using rbuffer_read() should
be better here.
|
| | |
|
| | |
|
| |
|
| |
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* fix(coverity/349942): structurally dead code
* fix(coverity/331396): operands don't affect result
* fix(coverity/331393): operands don't affect result
* fix(coverity/331392): operands don't affect result
* fix(coverity/331384): operands don't affect result
* fix(coverity/331374): operands don't affect result
* fix(coverity/331372): operands don't affect result
* fix(coverity/331371): operands don't affect result
* fix(coverity/331364): operands don't affect result
* fix(coverity/105585): operands don't affect result
|
| |
|
|
|
|
|
|
| |
This commit finishes support for colored and styled underlines adding
`CSI 4 : [2,4,5] m` support providing double, dashed, and dotted
underlines
Fixes #17362.
|
| | |
|
| |
|
|
|
|
| |
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: Dani Dickstein <daniel.dickstein@gmail.com>
Co-authored-by: Axel Dahlberg <git@valleymnt.com>
|
| |
|
|
|
|
|
|
| |
Problem: Some type casts are redundant.
Solution: Remove the type casts. (closes vim/vim#9643)
https://github.com/vim/vim/commit/420fabcd4ffeaf79082a6e43db91e1d363f88f27
This is not a literal port but an equivalent one.
|
| |
|
|
|
|
|
|
|
| |
Co-authored-by: Gregory Anders <8965202+gpanders@users.noreply.github.com>
Co-authored-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: Christoph Hasse <hassec@users.noreply.github.com>
Co-authored-by: Alef Pereira <ealefpereira@gmail.com>
Co-authored-by: AusCyber <willp@outlook.com.au>
Co-authored-by: kylo252 <59826753+kylo252@users.noreply.github.com>
|
| | |
|
| | |
|
| |
|
|
|
|
| |
The latter were added for xterm by ncurses 6.3 and are similarly
affected.
Fixes https://github.com/neovim/neovim/issues/16238
|
| |
|
|
|
|
|
|
|
| |
Problem: Giving error messages is not flexible.
Solution: Add semsg(). Change argument from "char_u *" to "char *", also
for msg() and get rid of most MSG macros. (Ozaki Kiichi, closes
vim/vim#3302) Also make emsg() accept a "char *" argument. Get rid of
an enormous number of type casts.
https://github.com/vim/vim/commit/f9e3e09fdc93be9f0d47afbc6c7df1188c2a5a0d
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
| |
* refactor: format all C files under nvim
* refactor: disable formatting for Vim-owned files:
* src/nvim/indent_c.c
* src/nvim/regexp.c
* src/nvim/regexp_nfa.c
* src/nvim/testdir/samples/memfile_test.c
|
| |
|
|
|
|
| |
* refactor: format header files with uncrustify
* fixup(justin): skip formatting of terminfo_defs.h
* fixup: force winsock2 to be included first
* fixup: simplify disable/enable directive to "uncrustify:off/on"
|
| |
|
|
|
| |
Before #15889, we used our fork of libuv which supports Windows 7/8.
After #15889, we use upstream libuv, which does not support Windows 7 and lacks
mouse/altbuf support for Windows 8 console.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
* refactor: format with uncrustify
* fixup(dundar): fix functions comments
* fixup(dundar): remove space between variable and ++/--
* fixup(dundar): better workaround for macro attributes
This is done to be able to better use uncrustify rules for macros
* fixup(justin): make preprocessors follow neovim style guide
|
| | |
|
| |
|
| |
Apply "redundant cast to the same type" fix from clangd.
|
| | |
|
| | |
|
| |
|
|
| |
There's already an ignore directive but it's placed on the wrong line.
This commit should correct it.
|
| |
|
|
|
| |
False positive. Documentation for grid_scroll says "`cols` is always
zero, reserved for future use".
|