changeset 7064:5fc5c5bf2233 v7.4.844

commit https://github.com/vim/vim/commit/37a8de17d4dfd3d463960c38a204ce399c8e19d4 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Sep 1 16:05:00 2015 +0200 patch 7.4.844 Problem: When '#' is in 'isident' the is# comparator doesn't work. Solution: Don't use vim_isIDc(). (Yasuhiro Matsumoto)
author Christian Brabandt <cb@256bit.org>
date Tue, 01 Sep 2015 16:15:04 +0200
parents 91d434c99f2d
children 95f9418597e0
files src/eval.c src/testdir/Make_amiga.mak src/testdir/Make_dos.mak src/testdir/Make_ming.mak src/testdir/Make_os2.mak src/testdir/Make_vms.mms src/testdir/Makefile src/testdir/test_comparators.in src/testdir/test_comparators.ok src/version.c
diffstat 10 files changed, 34 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/eval.c
+++ b/src/eval.c
@@ -4431,7 +4431,8 @@ eval4(arg, rettv, evaluate)
 		    {
 			if (p[2] == 'n' && p[3] == 'o' && p[4] == 't')
 			    len = 5;
-			if (!vim_isIDc(p[len]))
+			i = p[len];
+			if (!isalnum(i) && i != '_')
 			{
 			    type = len == 2 ? TYPE_EQUAL : TYPE_NEQUAL;
 			    type_is = TRUE;
--- a/src/testdir/Make_amiga.mak
+++ b/src/testdir/Make_amiga.mak
@@ -45,6 +45,7 @@ SCRIPTS = test1.out test3.out test4.out 
 		test_charsearch.out \
 		test_close_count.out \
 		test_command_count.out \
+		test_comparators.out \
 		test_erasebackword.out \
 		test_eval.out \
 		test_fixeol.out \
@@ -198,6 +199,7 @@ test_changelist.out: test_changelist.in
 test_charsearch.out: test_charsearch.in
 test_close_count.out: test_close_count.in
 test_command_count.out: test_command_count.in
+test_comparators.out: test_comparators.in
 test_erasebackword.out: test_erasebackword.in
 test_eval.out: test_eval.in
 test_increment.out: test_increment.in
--- a/src/testdir/Make_dos.mak
+++ b/src/testdir/Make_dos.mak
@@ -44,6 +44,7 @@ SCRIPTS =	test3.out test4.out test5.out 
 		test_charsearch.out \
 		test_close_count.out \
 		test_command_count.out \
+		test_comparators.out \
 		test_erasebackword.out \
 		test_eval.out \
 		test_fixeol.out \
--- a/src/testdir/Make_ming.mak
+++ b/src/testdir/Make_ming.mak
@@ -66,6 +66,7 @@ SCRIPTS =	test3.out test4.out test5.out 
 		test_charsearch.out \
 		test_close_count.out \
 		test_command_count.out \
+		test_comparators.out \
 		test_erasebackword.out \
 		test_eval.out \
 		test_fixeol.out \
--- a/src/testdir/Make_os2.mak
+++ b/src/testdir/Make_os2.mak
@@ -46,6 +46,7 @@ SCRIPTS = test1.out test3.out test4.out 
 		test_charsearch.out \
 		test_close_count.out \
 		test_command_count.out \
+		test_comparators.out \
 		test_erasebackword.out \
 		test_eval.out \
 		test_fixeol.out \
--- a/src/testdir/Make_vms.mms
+++ b/src/testdir/Make_vms.mms
@@ -4,7 +4,7 @@
 # Authors:	Zoltan Arpadffy, <arpadffy@polarhome.com>
 #		Sandor Kopanyi,  <sandor.kopanyi@mailbox.hu>
 #
-# Last change:  2015 Aug 11
+# Last change:  2015 Sep 01
 #
 # This has been tested on VMS 6.2 to 8.3 on DEC Alpha, VAX and IA64.
 # Edit the lines in the Configuration section below to select.
@@ -105,6 +105,7 @@ SCRIPT = test1.out  test2.out  test3.out
 	 test_charsearch.out \
 	 test_close_count.out \
 	 test_command_count.out \
+	 test_comparators.out \
 	 test_erasebackword.out \
 	 test_eval.out \
 	 test_fixeol.out \
--- a/src/testdir/Makefile
+++ b/src/testdir/Makefile
@@ -42,6 +42,7 @@ SCRIPTS = test1.out test2.out test3.out 
 		test_charsearch.out \
 		test_close_count.out \
 		test_command_count.out \
+		test_comparators.out \
 		test_erasebackword.out \
 		test_eval.out \
 		test_fixeol.out \
new file mode 100644
--- /dev/null
+++ b/src/testdir/test_comparators.in
@@ -0,0 +1,21 @@
+" Test for expression comparators.   vim: set ft=vim :
+
+
+STARTTEST
+:so small.vim
+:try
+:  let oldisident=&isident
+:  set isident+=#
+:  if 1 is#1
+:    $put ='ok'
+:  else
+:    $put ='ng'
+:  endif
+:finally
+:  let &isident=oldisident
+:endtry
+:"
+:/^marker/+1,$wq! test.out
+ENDTEST
+
+marker
new file mode 100644
--- /dev/null
+++ b/src/testdir/test_comparators.ok
@@ -0,0 +1,1 @@
+ok
--- a/src/version.c
+++ b/src/version.c
@@ -742,6 +742,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    844,
+/**/
     843,
 /**/
     842,