]> granicus.if.org Git - vim/commitdiff
updated for version 7.4.201 v7.4.201
authorBram Moolenaar <Bram@vim.org>
Wed, 12 Mar 2014 17:55:58 +0000 (18:55 +0100)
committerBram Moolenaar <Bram@vim.org>
Wed, 12 Mar 2014 17:55:58 +0000 (18:55 +0100)
Problem:    'lispwords' is a global option.
Solution:   Make 'lispwords' global-local. (Sung Pae)

runtime/doc/options.txt
runtime/optwin.vim
src/buffer.c
src/misc1.c
src/option.c
src/option.h
src/structs.h
src/testdir/test100.in
src/testdir/test100.ok
src/version.c

index 9fb67a2cff3336f152a630b07cb2f11063817a02..2b846b87d68f67781afda1107e93ceddc890ee84 100644 (file)
@@ -4629,7 +4629,7 @@ A jump table for the options with a short description can be found at |Q_op|.
 
                                                *'lispwords'* *'lw'*
 'lispwords' 'lw'       string  (default is very long)
-                       global
+                       global or local to buffer |global-local|
                        {not in Vi}
                        {not available when compiled without the |+lispindent|
                        feature}
index df3688381d9ca26b9a7a6c584bdf6d7009af162f..89ebe26a3e79d8c8d16f2fa625d020b3b3c8db6c 100644 (file)
@@ -855,7 +855,7 @@ if has("lispindent")
   call append("$", "\t(local to buffer)")
   call <SID>BinOptionL("lisp")
   call append("$", "lispwords\twords that change how lisp indenting works")
-  call <SID>OptionG("lw", &lw)
+  call <SID>OptionL("lw", &lw)
 endif
 
 
index 4eaf3dbe5efd5151e1abff847fe602722962f1b5..d68646790ea2e3822703e87b9ea79e8ac6c5175b 100644 (file)
@@ -1978,6 +1978,9 @@ free_buf_options(buf, free_p_ff)
 #endif
     buf->b_p_ar = -1;
     buf->b_p_ul = NO_LOCAL_UNDOLEVEL;
+#ifdef FEAT_LISP
+    clear_string_option(&buf->b_p_lw);
+#endif
 }
 
 /*
index b258d0bc932406b1761925f46089abdc73fbfd74..943496186041840e99f6957ec989dea7e2f9e923 100644 (file)
@@ -8879,7 +8879,7 @@ lisp_match(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)
     {
index 8c72da6391debb5a8c2ea3ad3edd77fd638fd2a0..b1c888d8ca818da6fa5464b82597c88e676e7c25 100644 (file)
 #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 @@ static struct vimoption
                            {(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_buf_options(buf)
     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 @@ unset_global_local_option(name, from)
        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 @@ get_varp_scope(p, opt_flags)
            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 @@ get_varp(p)
 #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 @@ buf_copy_options(buf, flags)
 #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,
index ce2dd00aaa899450ed999bfdb771abb26e4c89f6..5144c3373b563668826e46e99b4a98d403702a28 100644 (file)
@@ -990,6 +990,7 @@ enum
     , BV_KP
 #ifdef FEAT_LISP
     , BV_LISP
+    , BV_LW
 #endif
     , BV_MA
     , BV_ML
index 97601af29c73c76ffa6695d6991af666dae547ed..3f0a948b8fdf0acda1d97c26c7e882c39f1607a3 100644 (file)
@@ -1641,6 +1641,9 @@ struct file_buffer
 #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 */
 
index e42331946ce30e32948cf9bdb4d6f75060a2d7bb..61d28c15f094a75ace533de27c14b394de7e0d27 100644 (file)
@@ -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 @@ 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
 
index 95b318461c7d5160f229b2a4aafb93d18e5868f1..477106b8f2146265b0076234868dce204b533ef7 100644 (file)
@@ -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
index 4f953e3214e92b5227ec849b73f37d5af15388b7..30d762b7851497a92fb64b814a3ac5990e3319a0 100644 (file)
@@ -738,6 +738,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    201,
 /**/
     200,
 /**/