aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2014-08-15 13:53:26 -0400
committerJustin M. Keyes <justinkz@gmail.com>2014-08-15 13:53:26 -0400
commit19207762fd6dccd83b89c96bb1163b0d0440defb (patch)
treee3722355f655da4bba0db2a0a7fef04b6d204cd1
parent933602b1882c6596f06125fc621825c357409899 (diff)
parent9c8da794e114c3cd5cafe1edac9a8711506a7ba5 (diff)
downloadrneovim-19207762fd6dccd83b89c96bb1163b0d0440defb.tar.gz
rneovim-19207762fd6dccd83b89c96bb1163b0d0440defb.tar.bz2
rneovim-19207762fd6dccd83b89c96bb1163b0d0440defb.zip
Merge pull request #1068 from atwupack/vp-7.4.201
vim-patch:7.4.201
-rw-r--r--src/nvim/buffer.c1
-rw-r--r--src/nvim/buffer_defs.h1
-rw-r--r--src/nvim/indent.c2
-rw-r--r--src/nvim/option.c11
-rw-r--r--src/nvim/option_defs.h1
-rw-r--r--src/nvim/testdir/test100.in8
-rw-r--r--src/nvim/testdir/test100.ok10
-rw-r--r--src/nvim/version.c2
8 files changed, 33 insertions, 3 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c
index ee2b1ecf1d..8bcb5934dc 100644
--- a/src/nvim/buffer.c
+++ b/src/nvim/buffer.c
@@ -1517,6 +1517,7 @@ void free_buf_options(buf_T *buf, int free_p_ff)
clear_string_option(&buf->b_p_qe);
buf->b_p_ar = -1;
buf->b_p_ul = NO_LOCAL_UNDOLEVEL;
+ clear_string_option(&buf->b_p_lw);
}
/*
diff --git a/src/nvim/buffer_defs.h b/src/nvim/buffer_defs.h
index e827642d8a..9f5d7b86eb 100644
--- a/src/nvim/buffer_defs.h
+++ b/src/nvim/buffer_defs.h
@@ -677,6 +677,7 @@ struct file_buffer {
char_u *b_p_tsr; /* 'thesaurus' local value */
long b_p_ul; /* 'undolevels' local value */
int b_p_udf; /* 'undofile' */
+ char_u *b_p_lw; // 'lispwords' local value
/* end of buffer options */
diff --git a/src/nvim/indent.c b/src/nvim/indent.c
index ebc5955bae..d4c6b36177 100644
--- a/src/nvim/indent.c
+++ b/src/nvim/indent.c
@@ -690,7 +690,7 @@ static int lisp_match(char_u *p)
{
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) {
(void)copy_option_part(&word, buf, LSIZE, ",");
diff --git a/src/nvim/option.c b/src/nvim/option.c
index ca49a3dcb8..ebbba28b9d 100644
--- a/src/nvim/option.c
+++ b/src/nvim/option.c
@@ -143,6 +143,7 @@
# define PV_KMAP OPT_BUF(BV_KMAP)
#define PV_KP OPT_BOTH(OPT_BUF(BV_KP))
# define PV_LISP OPT_BUF(BV_LISP)
+# define PV_LW OPT_BOTH(OPT_BUF(BV_LW))
#define PV_MA OPT_BUF(BV_MA)
#define PV_ML OPT_BUF(BV_ML)
#define PV_MOD OPT_BUF(BV_MOD)
@@ -1057,7 +1058,7 @@ static struct vimoption
(char_u *)&p_lisp, PV_LISP,
{(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
{"lispwords", "lw", P_STRING|P_VI_DEF|P_COMMA|P_NODUP,
- (char_u *)&p_lispwords, PV_NONE,
+ (char_u *)&p_lispwords, PV_LW,
{(char_u *)LISPWORD_VALUE, (char_u *)0L}
SCRIPTID_INIT},
{"list", NULL, P_BOOL|P_VI_DEF|P_RWIN,
@@ -3558,6 +3559,7 @@ void check_buf_options(buf_T *buf)
check_string_option(&buf->b_p_tags);
check_string_option(&buf->b_p_dict);
check_string_option(&buf->b_p_tsr);
+ check_string_option(&buf->b_p_lw);
}
/*
@@ -6583,6 +6585,9 @@ void unset_global_local_option(char *name, void *from)
case PV_UL:
buf->b_p_ul = NO_LOCAL_UNDOLEVEL;
break;
+ case PV_LW:
+ clear_string_option(&buf->b_p_lw);
+ break;
}
}
@@ -6612,6 +6617,7 @@ static char_u *get_varp_scope(struct vimoption *p, int opt_flags)
case PV_TSR: return (char_u *)&(curbuf->b_p_tsr);
case PV_STL: return (char_u *)&(curwin->w_p_stl);
case PV_UL: return (char_u *)&(curbuf->b_p_ul);
+ case PV_LW: return (char_u *)&(curbuf->b_p_lw);
}
return NULL; /* "cannot happen" */
}
@@ -6659,6 +6665,8 @@ static char_u *get_varp(struct vimoption *p)
? (char_u *)&(curwin->w_p_stl) : p->var;
case PV_UL: return curbuf->b_p_ul != NO_LOCAL_UNDOLEVEL
? (char_u *)&(curbuf->b_p_ul) : p->var;
+ case PV_LW: return *curbuf->b_p_lw != NUL
+ ? (char_u *)&(curbuf->b_p_lw) : p->var;
case PV_ARAB: return (char_u *)&(curwin->w_p_arab);
case PV_LIST: return (char_u *)&(curwin->w_p_list);
@@ -7011,6 +7019,7 @@ void buf_copy_options(buf_T *buf, int flags)
buf->b_p_tsr = empty_option;
buf->b_p_qe = vim_strsave(p_qe);
buf->b_p_udf = p_udf;
+ buf->b_p_lw = empty_option;
/*
* Don't copy the options set by ex_help(), use the saved values,
diff --git a/src/nvim/option_defs.h b/src/nvim/option_defs.h
index 88f095fdce..d862ab2761 100644
--- a/src/nvim/option_defs.h
+++ b/src/nvim/option_defs.h
@@ -684,6 +684,7 @@ enum {
, BV_KMAP
, BV_KP
, BV_LISP
+ , BV_LW
, BV_MA
, BV_ML
, BV_MOD
diff --git a/src/nvim/testdir/test100.in b/src/nvim/testdir/test100.in
index e42331946c..f9f5f9119f 100644
--- a/src/nvim/testdir/test100.in
+++ b/src/nvim/testdir/test100.in
@@ -37,6 +37,14 @@ STARTTEST
: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/nvim/testdir/test100.ok b/src/nvim/testdir/test100.ok
index 95b318461c..477106b8f2 100644
--- a/src/nvim/testdir/test100.ok
+++ b/src/nvim/testdir/test100.ok
@@ -39,3 +39,13 @@ THREE: expecting global undolevels: 50, local undolevels: -123456 (default)
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/nvim/version.c b/src/nvim/version.c
index 0d5479506f..9f0909fb18 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -348,7 +348,7 @@ static int included_patches[] = {
204,
203,
//202,
- //201,
+ 201,
//200,
199,
//198,