updated for version 7.4.201
Problem: 'lispwords' is a global option.
Solution: Make 'lispwords' global-local. (Sung Pae)
diff --git a/src/buffer.c b/src/buffer.c
index 4eaf3db..d686467 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -1978,6 +1978,9 @@
#endif
buf->b_p_ar = -1;
buf->b_p_ul = NO_LOCAL_UNDOLEVEL;
+#ifdef FEAT_LISP
+ clear_string_option(&buf->b_p_lw);
+#endif
}
/*
diff --git a/src/misc1.c b/src/misc1.c
index b258d0b..9434961 100644
--- a/src/misc1.c
+++ b/src/misc1.c
@@ -8879,7 +8879,7 @@
{
char_u buf[LSIZE];
int len;
- char_u *word = p_lispwords;
+ char_u *word = *curbuf->b_p_lw != NUL ? curbuf->b_p_lw : p_lispwords;
while (*word != NUL)
{
diff --git a/src/option.c b/src/option.c
index 8c72da6..b1c888d 100644
--- a/src/option.c
+++ b/src/option.c
@@ -134,6 +134,7 @@
#define PV_KP OPT_BOTH(OPT_BUF(BV_KP))
#ifdef FEAT_LISP
# define PV_LISP OPT_BUF(BV_LISP)
+# define PV_LW OPT_BOTH(OPT_BUF(BV_LW))
#endif
#define PV_MA OPT_BUF(BV_MA)
#define PV_ML OPT_BUF(BV_ML)
@@ -1718,7 +1719,7 @@
{(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
{"lispwords", "lw", P_STRING|P_VI_DEF|P_COMMA|P_NODUP,
#ifdef FEAT_LISP
- (char_u *)&p_lispwords, PV_NONE,
+ (char_u *)&p_lispwords, PV_LW,
{(char_u *)LISPWORD_VALUE, (char_u *)0L}
#else
(char_u *)NULL, PV_NONE,
@@ -5412,6 +5413,9 @@
check_string_option(&buf->b_p_dict);
check_string_option(&buf->b_p_tsr);
#endif
+#ifdef FEAT_LISP
+ check_string_option(&buf->b_p_lw);
+#endif
}
/*
@@ -9879,6 +9883,11 @@
case PV_UL:
buf->b_p_ul = NO_LOCAL_UNDOLEVEL;
break;
+#ifdef FEAT_LISP
+ case PV_LW:
+ clear_string_option(&buf->b_p_lw);
+ break;
+#endif
}
}
@@ -9928,6 +9937,9 @@
case PV_STL: return (char_u *)&(curwin->w_p_stl);
#endif
case PV_UL: return (char_u *)&(curbuf->b_p_ul);
+#ifdef FEAT_LISP
+ case PV_LW: return (char_u *)&(curbuf->b_p_lw);
+#endif
}
return NULL; /* "cannot happen" */
}
@@ -9994,6 +10006,10 @@
#endif
case PV_UL: return curbuf->b_p_ul != NO_LOCAL_UNDOLEVEL
? (char_u *)&(curbuf->b_p_ul) : p->var;
+#ifdef FEAT_LISP
+ case PV_LW: return *curbuf->b_p_lw != NUL
+ ? (char_u *)&(curbuf->b_p_lw) : p->var;
+#endif
#ifdef FEAT_ARABIC
case PV_ARAB: return (char_u *)&(curwin->w_p_arab);
@@ -10567,6 +10583,9 @@
#ifdef FEAT_PERSISTENT_UNDO
buf->b_p_udf = p_udf;
#endif
+#ifdef FEAT_LISP
+ buf->b_p_lw = empty_option;
+#endif
/*
* Don't copy the options set by ex_help(), use the saved values,
diff --git a/src/option.h b/src/option.h
index ce2dd00..5144c33 100644
--- a/src/option.h
+++ b/src/option.h
@@ -990,6 +990,7 @@
, BV_KP
#ifdef FEAT_LISP
, BV_LISP
+ , BV_LW
#endif
, BV_MA
, BV_ML
diff --git a/src/structs.h b/src/structs.h
index 97601af..3f0a948 100644
--- a/src/structs.h
+++ b/src/structs.h
@@ -1641,6 +1641,9 @@
#ifdef FEAT_PERSISTENT_UNDO
int b_p_udf; /* 'undofile' */
#endif
+#ifdef FEAT_LISP
+ char_u *b_p_lw; /* 'lispwords' local value */
+#endif
/* end of buffer options */
diff --git a/src/testdir/test100.in b/src/testdir/test100.in
index e423319..61d28c1 100644
--- a/src/testdir/test100.in
+++ b/src/testdir/test100.in
@@ -1,4 +1,4 @@
-Tests for 'undolevel' setting being global-local
+Tests for 'undolevel' and 'lispwords' settings being global-local
STARTTEST
:so small.vim
@@ -37,6 +37,14 @@
:call UndoLevel()
:%w >> test.out
:"sleep 10
+:"
+:" Testing 'lispwords'
+:"
+:setglobal lispwords=foo,bar,baz
+:setlocal lispwords-=foo | setlocal lispwords+=quux
+:redir >> test.out | echon "\nTesting 'lispwords' local value" | setglobal lispwords? | setlocal lispwords? | echo &lispwords . "\n" | redir end
+:setlocal lispwords<
+:redir >> test.out | echon "\nTesting 'lispwords' value reset" | setglobal lispwords? | setlocal lispwords? | echo &lispwords . "\n" | redir end
:qa!
ENDTEST
diff --git a/src/testdir/test100.ok b/src/testdir/test100.ok
index 95b3184..477106b 100644
--- a/src/testdir/test100.ok
+++ b/src/testdir/test100.ok
@@ -39,3 +39,13 @@
undolevels=50 global
undolevels=-123456 local
+
+Testing 'lispwords' local value
+ lispwords=foo,bar,baz
+ lispwords=bar,baz,quux
+bar,baz,quux
+
+Testing 'lispwords' value reset
+ lispwords=foo,bar,baz
+ lispwords=foo,bar,baz
+foo,bar,baz
diff --git a/src/version.c b/src/version.c
index 4f953e3..30d762b 100644
--- a/src/version.c
+++ b/src/version.c
@@ -739,6 +739,8 @@
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 201,
+/**/
200,
/**/
199,