A recent refactor left cpy without a NUL terminator, simplify the code
instead of patching over it.
Instead of plain memcpy, it'd be better to employ harder to misuse string
functions made for this purpose like xstrlcpy(), but path_tail() takes
char_u arguments and returns them, leading to a lot of ugly casting.
Fixes#6431.
Problem: Crash when stop_timer() is called in a callback of a callback.
Vim hangs when the timer callback uses too much time.
Solution: Set tr_id to -1 when a timer is to be deleted. Don't keep calling
callbacks forever. (Ozaki Kiichi)
75537a93e9
Problem: In a timer callback the timer itself can't be found or stopped.
(Thinca)
Solution: Do not remove the timer from the list, remember whether it was
freed.
417ccd7138
- Use this to properly test cursor shape events.
- tests: update screen_basic_spec to use `screen:expect` short form.
Clearer than using `screen:wait` directy.
Adds os_strerror() result to a number of places. Also since I could not track
where err\* variables are NULL and where they are not, using macros to make sure
that all three variables are set at once.
Removes #ifdef UNIX around the use of os_fsync, makes it use os_close in place
of close in some places.
If we get a mouse_on/mouse_off event, but the mouse is already in the
corresponding state, there's no need to send the event up to the
terminal.
Closes#4394
For now only supports valid hex colors (does not check for the validity
the hex color) when termguicolors is set, otherwise it won't attempt to
change the cursor color.
If we `set pastetoggle=abcde`, and manually type it, then `vgetorpeek()`
sees part of the option before it has all been inserted into the
typebuffer.
To signify this it sets `keylen = KEYLEN_PART_KEY`, but the condition
about whether to return the current key from `vgetorpeek()` only checks
for `keylen = KEYLEN_PART_MAP`.
Add a check for `KEYLEN_PART_KEY` to account for the `'pastetoggle'`
option.