aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJurica Bradaric <jbradaric@gmail.com>2016-02-09 23:16:41 +0100
committerJustin M. Keyes <justinkz@gmail.com>2016-02-17 03:59:58 -0500
commit560a346d57f29ff549047b6d9e4434ddc6a3d0ed (patch)
treefd2562f40a93805426aab7dc777095fa7ed1304b
parent5f54519b4f2e4768e2541be39f67a33331f98bc4 (diff)
downloadrneovim-560a346d57f29ff549047b6d9e4434ddc6a3d0ed.tar.gz
rneovim-560a346d57f29ff549047b6d9e4434ddc6a3d0ed.tar.bz2
rneovim-560a346d57f29ff549047b6d9e4434ddc6a3d0ed.zip
vim-patch:7.4.844 #4228
Problem: When '#' is in 'isident' the is# comparator doesn't work. Solution: Don't use vim_isIDc(). (Yasuhiro Matsumoto) https://github.com/vim/vim/commit/37a8de17d4dfd3d463960c38a204ce399c8e19d4
-rw-r--r--src/nvim/eval.c5
-rw-r--r--src/nvim/version.c2
-rw-r--r--test/functional/legacy/comparators_spec.lua14
3 files changed, 18 insertions, 3 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index 327d0bf637..ec085efc07 100644
--- a/src/nvim/eval.c
+++ b/src/nvim/eval.c
@@ -3580,9 +3580,10 @@ static int eval4(char_u **arg, typval_T *rettv, int evaluate)
type = TYPE_SEQUAL;
break;
case 'i': if (p[1] == 's') {
- if (p[2] == 'n' && p[3] == 'o' && p[4] == 't')
+ if (p[2] == 'n' && p[3] == 'o' && p[4] == 't') {
len = 5;
- if (!vim_isIDc(p[len])) {
+ }
+ if (!isalnum(p[len]) && p[len] != '_') {
type = len == 2 ? TYPE_EQUAL : TYPE_NEQUAL;
type_is = TRUE;
}
diff --git a/src/nvim/version.c b/src/nvim/version.c
index 452f823539..ef38a9196f 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -444,7 +444,7 @@ static int included_patches[] = {
// 847,
// 846 NA
// 845,
- // 844,
+ 844,
843,
// 842 NA
// 841 NA
diff --git a/test/functional/legacy/comparators_spec.lua b/test/functional/legacy/comparators_spec.lua
new file mode 100644
index 0000000000..e3fa3eea23
--- /dev/null
+++ b/test/functional/legacy/comparators_spec.lua
@@ -0,0 +1,14 @@
+-- " Test for expression comparators.
+
+local helpers = require('test.functional.helpers')
+local clear, eq = helpers.clear, helpers.eq
+local eval, execute = helpers.eval, helpers.execute
+
+describe('comparators', function()
+ before_each(clear)
+
+ it('is working', function()
+ execute('set isident+=#')
+ eq(1, eval('1 is#1'))
+ end)
+end)