Problem: Using :change in between :function and :endfunction fails.
Solution: Recognize :change inside a function. (ichizok, closesvim/vim#1374)
70bcd7336f
Problem: str2nr() and str2float() do not always work with negative values.
Solution: Be more flexible about handling signs. (LemonBoy, closesvim/vim#1332)
Add more tests.
08243d26d2
Problem: On MS-Windows some float functions return a different value when
passed unusual values. strtod() doesn't work for "inf" and "nan".
Solution: Accept both results. Fix str2float() for MS-Windows. Also
reorder assert function arguments.
6247361101
This is a new convention pioneered by tmux. It does not do much for
nvim; since nvim always looks to see whether it should be making up
"setrgbf" and "setrgbb" capabilities. But it is a way for terminfo to
force this, irrespective of the hardwired list in the code, for more
terminal types. On the gripping hand, updating terminfo descriptions to
actually have "setrgbf" and "setrgbb" capabilities so that nvim never
has to try to invent them in the first place, is as good if not better
an approach for overriding what is baked into the code.
After merging +num64, the 64-bit sanitizer builds show that Vim doesn't
buffer the user from C's UB in signed arithmetic. Upstream doesn't
appear to be [interested] in fixing the issue, so suppress UBSAN until
someone decides to fix the problem.
N.B., the problem existed before but went unnoticed since the sanitizer
builds weren't being run in 32-bit mode.
[interested]: https://groups.google.com/d/topic/vim_dev/_tqf8eQy5eA/discussion
Problem: Ubsan reports errors for integer overflow.
Solution: Define macros for minimum and maximum values. Select an
expression based on the value. (Mike Williams)
7a40ea2138
Problem: Compiler warnings with older compiler and 64 bit numbers.
Solution: Add "LL" to large values. (Mike Williams)
af9c4c9b57
Equivalent change was made in ZyX's typval refactoring.
Problem: Compiler warns for loss of data.
Solution: Use size_t instead of int. (Christian Brabandt)
fef524bbff
Equivalent change had already been made when merging earlier pack
patches.
Problem: With 64 bit changes don't need three calls to sprintf().
Solution: Simplify the code, use vim_snprintf(). (Ken Takata)
bde9810d61
nvim already had the equivalent code, so only the patch number was
needed.
Problem: On MS-Windows large files (> 2Gbyte) cause problems.
Solution: Use "off_T" instead of "off_t". Use "stat_T" instead of "struct
stat". Use 64 bit system functions if available. (Ken Takata)
8767f52fbf
Only the off_T changes are relevant, since all the "struct stat" usage
is abstracted by libuv.
From observation, there are several different possible behaviours:
1. Deferred wrap like a real DEC VT. The cursor stays visible in the last
column, and CUB is calculated relative to that column.
Examples: xterm, Unicode rxvt, PuTTY, nosh console-terminal-emulator,
FreeBSD kernel's built-in emulator, Linux's built-in emulator
2. Deferred wrap like a real DEC VT. CUB is calculated relative to the last
column. But the cursor is invisible.
Examples: emulators using newer libvte
3. Non-deferred wrap. The cursor has already wrapped to the next line and CUB
does not wrap back.
Examples: cygwin, Interix
4. Non-deferred wrap that acts like deferred wrap. The cursor has already
visibly wrapped to the next line, but CUB can wrap back around the left
margin.
Examples: Konsole
5. Deferred wrap with visibly out of bounds cursor. The cursor visibly moves
outwith the screen boundaries. CUB is calculated relative to a cursor
column that has overflowed the end of the screen grid array.
Examples: iTerm2
6. Deferred wrap with invisibly out of bounds cursor. CUB is calculated
relative to a cursor column that has overflowed the end of the screen grid
array. And the cursor is invisible.
Examples: emulators using older libvte
In many cases, nvim does not have enough information to know which behaviour
the terminal will exhibit, and thus the correct amount of CUB to issue.
Partly undo 8ab08a65ba3bc9a44741a2ec9aa81fbcc77467fb. Further testing
by Enrico Ghirardi suggests limiting the non-deferred automatic wrap to
only the bottom line, whose rightmost column is not printed for iTerm.
They are now in their own nvim/tui/terminfo.c file.
Also turn the TERMINAL_FAMILY macro into a function. Use the terminfo_
prefix for its name as other parts of the program are unlikely to want
that namespace, and the prefix is already used for some other TUI
functions.
Testing by Enrico Ghirardi and review of the source indicates that
iTerm2 is a second terminal emulator that does not defer automatic wrap
at the right margin.
The example used &term which is no longer meaningful.
Fortunately, we can change this into a useful example using $TERM that also
shows how to address a common need with termguicolors at the same time.
PM...ST actually sends the string to screen's message area. Sending the
string to the status line requires a different control sequence peculiar to
screen.
Also make iTerm2 SGR 38/48 consistent.