memcpy is not equivalent to memmove (which is used by vim_strcat), this
could cause subtle bugs if xstrlcat is used as a replacement for
vim_strcat. But vim_strcat is inconsistent: in the `else` branch it uses
strcpy, which doesn't allow overlap.
Helped-by: oni-link <knil.ino@gmail.com>
Helped-by: James McCoy <jamessan@jamessan.com>
Helped-by: Nikolai Aleksandrovich Pavlov <kp-pav@yandex.ru>
Previously alternate branches were not accounted for properly, with this
change g- after an undo to a branch point works.
The current sequence number b_u_seq_cur is used in undo_time(), in
u_doit() this was calculated by subtracting one from the curhead
sequence number.
The curhead header entry represents the change that was just undone, so
the sequence number we want is that of the change we have moved to. This
is the sequence number of the undo head that is the uh_next element of
this curhead. That sequence number is not always one less than the
curhead sequence number -- there may have been an alternate branch at
this point.
Instead of subtracting one, we now directly find the sequence number of
curhead->uh_next.
Closes#3689
cmake: Add `desktop-install` and `icon-install` targets. `runtime`
target will trigger them.
Specification:
https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#recognized-keys
Icons are stored system-wide in /usr/share/applications or user wide at
/usr/share/icons/hicolor/scalable/apps and can be overriden in ~/.local/share/icons
nvim.desktop file can be installed system wide or in
~/.local/share/applications/
To test without an installer:
$ xdg-desktop-menu install --novendor runtime/nvim.desktop
$ xdg-icon-resource install --novendor --mode user --size 64 contrib/nvim-icon.png
Once it is installed, you can test with gtk-launch if installed or
dmenu/rofi (drun mode)
This default causes too much confusion for terminal users. Until
a better approach is implemented, revert to the traditional default.
Better solution would be:
- Implement a right-click menu for TUI
- Set 'mouse=a' *only* if clipboard is working.
Closes#5938
Closes#731
References #851
Note: This does not remove some intentional legacy usages of strncpy.
- memcpy isn't equivalent because it doesn't check the string
length of `src`, and doesn't zero-out the remainder of `dst`.
- xstrlcpy isn't equivalent because it doesn't zero-out the
remainder of `dst`. Some Vim logic depends on that (e.g.
ex_append which calls vim_strnsave).
Helped-by: Douglas Schneider <ds3@ualberta.ca>
Helped-by: oni-link <knil.ino@gmail.com>
Helped-by: James McCoy <jamessan@jamessan.com>
jemalloc's README states:
> jemalloc [is] the FreeBSD libc allocator since 2005. ... Modern jemalloc
> releases continue to be integrated back into FreeBSD
Since FreeBSD ships with jemalloc in some form, we don't need to require
jemalloc there. Less risk, low cost.
As discussed in neovim/neovim#5977, it's typical for the terminfo
database to disable cursor blink as part of setting up the normal
cursor. Since this interferes with the user's control over the cursor,
we'll skip over DECRST 12 if it starts the cursor_normal entry.
Note, this doesn't handle any case where DECRST 12 is not at the start
of the entry since unibilium simply stores the given pointer. We would
need to allocate (and somewhere free) a modified copy of what we get
back from unibi_get_str to handle that.
`find_command(s->ca.cmdchar) >= 0` was established near the start of
normal_execute(). And `unshift_special(&s->ca);` "should" not ever
result in s->ca.cmdchar containing a multibyte char.
So only an assert() is needed here.
Look for runtime dependencies diff.exe and win32yank.exe (and
recursively for DLL dependencies) and install them with nvim.exe. If a
dependency is missing a warning will be issued.
Also give NVIM_TUI_ENABLE_CURSOR_SHAPE more granularity:
0 = do not change cursor shape
1 = non-blinking ("steady") cursor with mode-sensitive shape
2 = blinking cursor with mode-sensitive shape
Note: blink state is not changed for Konsole, instead user's terminal
preference makes the decision. (Can't do that for xterm-likes, DECSCUSR
forces us to choose blink-state.)
This is a temporary step until the TUI respects 'guicursor'
Ref: https://github.com/neovim/neovim/issues/2583#issuecomment-272988384
"CSI ? 12 l" stops cursor blinking. `unibi_cursor_normal` need only
_show_ the cursor, not make any pronouncement about cursor blinking.
User's terminal setting (or NVIM_TUI_ENABLE_CURSOR_SHAPE) takes
precedence.
Test sometimes fails on AppVeyor (Windows). 300/50=6, but there could be
environment factors that miss the timer interval on the "edges".
timer_start() does not have such a hard requirement.