aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/nvim/regexp.c4
-rw-r--r--src/nvim/search.c10
-rw-r--r--src/nvim/spell.c2
-rw-r--r--test/includes/pre/uv.h4
-rw-r--r--test/unit/os/fs_spec.lua4
5 files changed, 10 insertions, 14 deletions
diff --git a/src/nvim/regexp.c b/src/nvim/regexp.c
index 414472a8f3..06b99d0b75 100644
--- a/src/nvim/regexp.c
+++ b/src/nvim/regexp.c
@@ -4323,8 +4323,10 @@ static int regmatch(
/* Still at same position as last time, fail. */
status = RA_NOMATCH;
- if (status != RA_FAIL && status != RA_NOMATCH)
+ assert(status != RA_FAIL);
+ if (status != RA_NOMATCH) {
reg_save(&bp[i].bp_pos, &backpos);
+ }
}
break;
diff --git a/src/nvim/search.c b/src/nvim/search.c
index c1770fd80d..9cda76d324 100644
--- a/src/nvim/search.c
+++ b/src/nvim/search.c
@@ -864,13 +864,11 @@ int searchit(
}
at_first_line = FALSE;
- /*
- * Stop the search if wrapscan isn't set, "stop_lnum" is
- * specified, after an interrupt, after a match and after looping
- * twice.
- */
+ // Stop the search if wrapscan isn't set, "stop_lnum" is
+ // specified, after an interrupt, after a match and after looping
+ // twice.
if (!p_ws || stop_lnum != 0 || got_int || called_emsg
- || (timed_out != NULL && timed_out)
+ || (timed_out != NULL && *timed_out)
|| break_loop
|| found || loop) {
break;
diff --git a/src/nvim/spell.c b/src/nvim/spell.c
index 893a13b9f0..cc214616f4 100644
--- a/src/nvim/spell.c
+++ b/src/nvim/spell.c
@@ -4500,7 +4500,7 @@ static void suggest_trie_walk(suginfo_T *su, langp_T *lp, char_u *fword, bool so
sp->ts_state = STATE_SWAP3;
break;
}
- if (c2 != NUL && TRY_DEEPER(su, stack, depth, SCORE_SWAP)) {
+ if (TRY_DEEPER(su, stack, depth, SCORE_SWAP)) {
go_deeper(stack, depth, SCORE_SWAP);
#ifdef DEBUG_TRIEWALK
snprintf(changename[depth], sizeof(changename[0]),
diff --git a/test/includes/pre/uv.h b/test/includes/pre/uv.h
deleted file mode 100644
index da7818cd07..0000000000
--- a/test/includes/pre/uv.h
+++ /dev/null
@@ -1,4 +0,0 @@
-#include <uv.h>
-
-static const int kUV_ENOENT = UV_ENOENT;
-static const int kUV_EEXIST = UV_EEXIST;
diff --git a/test/unit/os/fs_spec.lua b/test/unit/os/fs_spec.lua
index f1ec94ae87..526a09e845 100644
--- a/test/unit/os/fs_spec.lua
+++ b/test/unit/os/fs_spec.lua
@@ -27,7 +27,7 @@ cimport('./src/nvim/fileio.h')
local fs = cimport('./src/nvim/os/os.h', './src/nvim/path.h')
cppimport('sys/stat.h')
cppimport('fcntl.h')
-cppimport('uv.h')
+cimport('uv.h')
local s = ''
for i = 0, 255 do
@@ -540,7 +540,7 @@ describe('fs.c', function()
itp('returns UV_EEXIST for O_CREAT|O_EXCL on a existing file', function()
assert_file_exists(existing_file)
- eq(ffi.C.kUV_EEXIST, (os_open(existing_file, (bit.bor(ffi.C.kO_CREAT, ffi.C.kO_EXCL)), 0)))
+ eq(ffi.C.UV_EEXIST, (os_open(existing_file, (bit.bor(ffi.C.kO_CREAT, ffi.C.kO_EXCL)), 0)))
end)
itp('sets `rwx` permissions for O_CREAT 700 which then can be closed', function()