aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2018-12-24 10:59:24 +0100
committerGitHub <noreply@github.com>2018-12-24 10:59:24 +0100
commit9ac1e2db79e3a1d86ce9cf7c6ea9181126556fb9 (patch)
tree636ff5ef7231f0f5bbbf13f92b43fa1ea4472abb
parente9685d9f70f26daa6a252baf8f5a2d411cf4b38f (diff)
parent357e59982d014cccf14ccc092470250c011b8e44 (diff)
downloadrneovim-9ac1e2db79e3a1d86ce9cf7c6ea9181126556fb9.tar.gz
rneovim-9ac1e2db79e3a1d86ce9cf7c6ea9181126556fb9.tar.bz2
rneovim-9ac1e2db79e3a1d86ce9cf7c6ea9181126556fb9.zip
Merge pull request #9394 from bfredl/highsign
make vim_snprintf handle %d correctly again, fix ":sign place" output
-rw-r--r--src/nvim/strings.c14
-rw-r--r--test/functional/ui/sign_spec.lua43
2 files changed, 54 insertions, 3 deletions
diff --git a/src/nvim/strings.c b/src/nvim/strings.c
index 87593f577b..4921824316 100644
--- a/src/nvim/strings.c
+++ b/src/nvim/strings.c
@@ -999,7 +999,10 @@ int vim_vsnprintf(char *str, size_t str_m, const char *fmt, va_list ap,
} else if (fmt_spec == 'd') {
// signed
switch (length_modifier) {
- case '\0':
+ case '\0': {
+ arg = (int)(tvs ? tv_nr(tvs, &arg_idx) : va_arg(ap, int));
+ break;
+ }
case 'h': {
// char and short arguments are passed as int16_t
arg = (int16_t)(tvs ? tv_nr(tvs, &arg_idx) : va_arg(ap, int));
@@ -1031,11 +1034,16 @@ int vim_vsnprintf(char *str, size_t str_m, const char *fmt, va_list ap,
} else {
// unsigned
switch (length_modifier) {
- case '\0':
+ case '\0': {
+ uarg = (unsigned int)(tvs
+ ? tv_nr(tvs, &arg_idx)
+ : va_arg(ap, unsigned int));
+ break;
+ }
case 'h': {
uarg = (uint16_t)(tvs
? tv_nr(tvs, &arg_idx)
- : va_arg(ap, unsigned));
+ : va_arg(ap, unsigned int));
break;
}
case 'l': {
diff --git a/test/functional/ui/sign_spec.lua b/test/functional/ui/sign_spec.lua
index 6abeb0b2f4..bc0e2e3799 100644
--- a/test/functional/ui/sign_spec.lua
+++ b/test/functional/ui/sign_spec.lua
@@ -20,6 +20,9 @@ describe('Signs', function()
[6] = {foreground = Screen.colors.Brown},
[7] = {foreground = Screen.colors.DarkBlue, background = Screen.colors.LightGrey},
[8] = {foreground = Screen.colors.Grey100, background = Screen.colors.Red},
+ [9] = {bold = true, foreground = Screen.colors.Magenta},
+ [10] = {foreground = Screen.colors.Blue1},
+ [11] = {bold = true, foreground = Screen.colors.SeaGreen4},
} )
end)
@@ -111,5 +114,45 @@ describe('Signs', function()
|
]])
end)
+
+ it('can have 32bit sign IDs', function()
+ command('sign define piet text=>> texthl=Search')
+ command('sign place 100000 line=1 name=piet buffer=1')
+ feed(':sign place<cr>')
+ screen:expect([[
+ {1:>>} |
+ {2: }{0:~ }|
+ {2: }{0:~ }|
+ {2: }{0:~ }|
+ {2: }{0:~ }|
+ {2: }{0:~ }|
+ {2: }{0:~ }|
+ {4: }|
+ :sign place |
+ {9:--- Signs ---} |
+ {10:Signs for [NULL]:} |
+ line=1 id=100000 name=piet |
+ |
+ {11:Press ENTER or type command to continue}^ |
+ ]])
+
+ feed('<cr>')
+ screen:expect([[
+ {1:>>}^ |
+ {2: }{0:~ }|
+ {2: }{0:~ }|
+ {2: }{0:~ }|
+ {2: }{0:~ }|
+ {2: }{0:~ }|
+ {2: }{0:~ }|
+ {2: }{0:~ }|
+ {2: }{0:~ }|
+ {2: }{0:~ }|
+ {2: }{0:~ }|
+ {2: }{0:~ }|
+ {2: }{0:~ }|
+ |
+ ]])
+ end)
end)
end)