When using heirloom `vi` originally written by Bill Joy (`:version`
gives me "Version 4.0 (gritter) 12/25/06"), its possible to store text into
registers 1-9 and subsequently use the `:edit` or `:next` command to
change files and paste the contents of those numbered registers,
contrary to what Vim documentation states.
POSIX description also does not mention such a restriction:
https://pubs.opengroup.org/onlinepubs/9799919799/utilities/ex.html#tag_20_40_13_10closes: #15814
Signed-off-by: Frederick Key Abell III <fkabell@localhost.localdomain>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: String interpolation fails for Dict type
Solution: Support Dict data type properly, also support :put =Dict
(without having to convert it to string() first)
(Yegappan Lakshmanan)
fixes: #14529closes: #14541
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: [security]: overflow with count for :s command
Solution: Abort the :s command if the count is too large
If the count after the :s command is larger than what fits into a
(signed) long variable, abort with e_value_too_large.
Adds a test with INT_MAX as count and verify it correctly fails.
It seems the return value on Windows using mingw compiler wraps around,
so the initial test using :s/./b/9999999999999999999999999990 doesn't
fail there, since the count is wrapping around several times and finally
is no longer larger than 2147483647. So let's just use 2147483647 in the
test, which hopefully will always cause a failure
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: r_CTRL-C works differently in visual mode
Solution: Make r_CTRL-C behave consistent in visual mode
in terminal and Windows GUI
in visual mode, r CTRL-C behaves strange in Unix like environments. It
seems to end visual mode, but still is waiting for few more chars,
however it never seems to replace it by any characters and eventually
just returns back into normal mode.
In contrast in Windows GUI mode, r_CTRL-C replaces in the selected area
all characters by a literal CTRL-C.
Not sure why it behaves like this. It seems in the Windows GUI, got_int
is not set and therefore behaves as if any other normal character has
been pressed.
So remove the special casing of what happens when got_int is set and
make it always behave like in Windows GUI mode. Add a test to verify it
always behaves like replacing in the selected area each selected
character by a literal CTRL-C.
closes: #13091closes: #13112
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Some users do not want a line comment always inserted.
Solution: Add the '/' flag to 'formatoptions' to not repeat the comment
leader after a statement when using "o".
Problem: Cannot paste a block without adding padding.
Solution: Add "zp" and "zP" which paste without adding padding. (Christian
Brabandt, closes#8289)