aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nvim/arabic.c4
-rw-r--r--src/nvim/edit.c4
-rw-r--r--src/nvim/fileio.c3
-rw-r--r--src/nvim/normal.c2
-rw-r--r--src/nvim/option.c1
-rw-r--r--src/nvim/screen.c4
-rw-r--r--src/nvim/testdir/check.vim3
-rw-r--r--src/nvim/testdir/test_cmdline.vim29
8 files changed, 26 insertions, 24 deletions
diff --git a/src/nvim/arabic.c b/src/nvim/arabic.c
index 7f12c0c798..9fba38a49f 100644
--- a/src/nvim/arabic.c
+++ b/src/nvim/arabic.c
@@ -719,9 +719,7 @@ int arabic_shape(int c, int *ccp, int *c1p, int prev_c, int prev_c1,
// half-shape current and previous character
int shape_c = half_shape(prev_c);
- // Save away current character
- int curr_c = c;
-
+ int curr_c;
int curr_laa = A_firstc_laa(c, *c1p);
int prev_laa = A_firstc_laa(prev_c, prev_c1);
diff --git a/src/nvim/edit.c b/src/nvim/edit.c
index 36acc10f98..962ef9b245 100644
--- a/src/nvim/edit.c
+++ b/src/nvim/edit.c
@@ -3810,10 +3810,10 @@ static void ins_compl_fixRedoBufForLeader(char_u *ptr_arg)
*/
static buf_T *ins_compl_next_buf(buf_T *buf, int flag)
{
- static win_T *wp;
+ static win_T *wp = NULL;
if (flag == 'w') { // just windows
- if (buf == curbuf) { // first call for this flag/expansion
+ if (buf == curbuf || wp == NULL) { // first call for this flag/expansion
wp = curwin;
}
assert(wp);
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c
index e1e34bf24a..a542bb19dd 100644
--- a/src/nvim/fileio.c
+++ b/src/nvim/fileio.c
@@ -1652,9 +1652,6 @@ failed:
# ifdef HAVE_ICONV
if (iconv_fd != (iconv_t)-1) {
iconv_close(iconv_fd);
-# ifndef __clang_analyzer__
- iconv_fd = (iconv_t)-1;
-# endif
}
# endif
diff --git a/src/nvim/normal.c b/src/nvim/normal.c
index a2060b91f7..f93d772068 100644
--- a/src/nvim/normal.c
+++ b/src/nvim/normal.c
@@ -168,7 +168,7 @@ static const struct nv_cmd {
{ NL, nv_down, 0, false },
{ Ctrl_K, nv_error, 0, 0 },
{ Ctrl_L, nv_clear, 0, 0 },
- { Ctrl_M, nv_down, 0, true },
+ { CAR, nv_down, 0, true },
{ Ctrl_N, nv_down, NV_STS, false },
{ Ctrl_O, nv_ctrlo, 0, 0 },
{ Ctrl_P, nv_up, NV_STS, false },
diff --git a/src/nvim/option.c b/src/nvim/option.c
index f41c0761cc..d60c8bc01c 100644
--- a/src/nvim/option.c
+++ b/src/nvim/option.c
@@ -4338,6 +4338,7 @@ static char *set_num_option(int opt_idx, char_u *varp, long value,
char buf_old[NUMBUFLEN];
char buf_new[NUMBUFLEN];
char buf_type[7];
+
vim_snprintf(buf_old, ARRAY_SIZE(buf_old), "%ld", old_value);
vim_snprintf(buf_new, ARRAY_SIZE(buf_new), "%ld", value);
vim_snprintf(buf_type, ARRAY_SIZE(buf_type), "%s",
diff --git a/src/nvim/screen.c b/src/nvim/screen.c
index 8f78b5fc15..dc028f0ed7 100644
--- a/src/nvim/screen.c
+++ b/src/nvim/screen.c
@@ -3885,8 +3885,8 @@ static int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow,
/* check if line ends before left margin */
if (vcol < v + col - win_col_off(wp))
vcol = v + col - win_col_off(wp);
- /* Get rid of the boguscols now, we want to draw until the right
- * edge for 'cursorcolumn'. */
+ // Get rid of the boguscols now, we want to draw until the right
+ // edge for 'cursorcolumn'.
col -= boguscols;
// boguscols = 0; // Disabled because value never read after this
diff --git a/src/nvim/testdir/check.vim b/src/nvim/testdir/check.vim
index 467ff5a1e9..24d3959f83 100644
--- a/src/nvim/testdir/check.vim
+++ b/src/nvim/testdir/check.vim
@@ -12,6 +12,9 @@ endfunc
" Command to check for the presence of a working option.
command -nargs=1 CheckOption call CheckOption(<f-args>)
func CheckOption(name)
+ if !exists('&' .. a:name)
+ throw 'Checking for non-existent option ' .. a:name
+ endif
if !exists('+' .. a:name)
throw 'Skipped: ' .. a:name .. ' option not supported'
endif
diff --git a/src/nvim/testdir/test_cmdline.vim b/src/nvim/testdir/test_cmdline.vim
index bb0cae4819..39f865144a 100644
--- a/src/nvim/testdir/test_cmdline.vim
+++ b/src/nvim/testdir/test_cmdline.vim
@@ -51,18 +51,21 @@ func Test_complete_wildmenu()
call feedkeys(":e Xdir1/\<Tab>\<Down>\<Up>\<Right>\<CR>", 'tx')
call assert_equal('testfile1', getline(1))
- + " <C-J>/<C-K> mappings to go up/down directories when 'wildcharm' is
- " different than 'wildchar'.
- set wildcharm=<C-Z>
- cnoremap <C-J> <Down><C-Z>
- cnoremap <C-K> <Up><C-Z>
- call feedkeys(":e Xdir1/\<Tab>\<C-J>\<CR>", 'tx')
- call assert_equal('testfile3', getline(1))
- call feedkeys(":e Xdir1/\<Tab>\<C-J>\<C-K>\<CR>", 'tx')
- call assert_equal('testfile1', getline(1))
- set wildcharm=0
- cunmap <C-J>
- cunmap <C-K>
+ " this fails in some Unix GUIs, not sure why
+ if !has('unix') || !has('gui_running')
+ " <C-J>/<C-K> mappings to go up/down directories when 'wildcharm' is
+ " different than 'wildchar'.
+ set wildcharm=<C-Z>
+ cnoremap <C-J> <Down><C-Z>
+ cnoremap <C-K> <Up><C-Z>
+ call feedkeys(":e Xdir1/\<Tab>\<C-J>\<CR>", 'tx')
+ call assert_equal('testfile3', getline(1))
+ call feedkeys(":e Xdir1/\<Tab>\<C-J>\<C-K>\<CR>", 'tx')
+ call assert_equal('testfile1', getline(1))
+ set wildcharm=0
+ cunmap <C-J>
+ cunmap <C-K>
+ endif
" cleanup
%bwipe
@@ -1001,4 +1004,4 @@ func Test_read_shellcmd()
endif
endfunc
-" vim: shiftwidth=2 sts=2 expandtab " vim: shiftwidth=2 sts=2 expandtab
+" vim: shiftwidth=2 sts=2 expandtab