4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
11 Problem: When the 'keymap' and 'paste' options have a non-default value,
12 ":mkexrc" and ":mksession" do not correctly set the options.
13 Solution: Set the options with side effects before other options.
17 *** ../vim-7.1.098/src/option.c Thu Sep 6 13:32:53 2007
18 --- src/option.c Wed Sep 5 22:34:27 2007
22 #define P_NOGLOB 0x100000L/* do not use local value for global vimrc */
23 #define P_NFNAME 0x200000L/* only normal file name chars allowed */
24 #define P_INSECURE 0x400000L/* option was set from a modeline */
25 + #define P_PRI_MKRC 0x800000L/* priority for :mkvimrc (setting option has
28 #define ISK_LATIN1 (char_u *)"@,48-57,_,192-255"
33 {(char_u *)0L, (char_u *)0L}
36 + /* P_PRI_MKRC isn't needed here, optval_default()
37 + * always returns TRUE for 'compatible' */
38 {"compatible", "cp", P_BOOL|P_RALL,
39 (char_u *)&p_cp, PV_NONE,
40 {(char_u *)TRUE, (char_u *)FALSE}},
43 {(char_u *)0L, (char_u *)0L}
46 ! {"keymap", "kmp", P_STRING|P_ALLOCED|P_VI_DEF|P_RBUF|P_RSTAT|P_NFNAME,
48 (char_u *)&p_keymap, PV_KMAP,
49 {(char_u *)"", (char_u *)0L}
51 {(char_u *)0L, (char_u *)0L}
54 ! {"keymap", "kmp", P_STRING|P_ALLOCED|P_VI_DEF|P_RBUF|P_RSTAT|P_NFNAME|P_PRI_MKRC,
56 (char_u *)&p_keymap, PV_KMAP,
57 {(char_u *)"", (char_u *)0L}
60 {"paragraphs", "para", P_STRING|P_VI_DEF,
61 (char_u *)&p_para, PV_NONE,
62 {(char_u *)"IPLPPPQPP LIpplpipbp", (char_u *)0L}},
63 ! {"paste", NULL, P_BOOL|P_VI_DEF,
64 (char_u *)&p_paste, PV_NONE,
65 {(char_u *)FALSE, (char_u *)0L}},
66 {"pastetoggle", "pt", P_STRING|P_VI_DEF,
68 {"paragraphs", "para", P_STRING|P_VI_DEF,
69 (char_u *)&p_para, PV_NONE,
70 {(char_u *)"IPLPPPQPP LIpplpipbp", (char_u *)0L}},
71 ! {"paste", NULL, P_BOOL|P_VI_DEF|P_PRI_MKRC,
72 (char_u *)&p_paste, PV_NONE,
73 {(char_u *)FALSE, (char_u *)0L}},
74 {"pastetoggle", "pt", P_STRING|P_VI_DEF,
77 char_u *varp_local = NULL; /* fresh value */
82 * The options that don't have a default (terminal name, columns, lines)
83 * are never written. Terminal options are also not written.
85 ! for (p = &options[0]; !istermoption(p); p++)
86 ! if (!(p->flags & P_NO_MKRC) && !istermoption(p))
88 /* skip global option when only doing locals */
89 if (p->indir == PV_NONE && !(opt_flags & OPT_GLOBAL))
91 char_u *varp_local = NULL; /* fresh value */
97 * The options that don't have a default (terminal name, columns, lines)
98 * are never written. Terminal options are also not written.
99 + * Do the loop over "options[]" twice: once for options with the
100 + * P_PRI_MKRC flag and once without.
102 ! for (pri = 1; pri >= 0; --pri)
104 ! for (p = &options[0]; !istermoption(p); p++)
105 ! if (!(p->flags & P_NO_MKRC)
106 ! && !istermoption(p)
107 ! && ((pri == 1) == ((p->flags & P_PRI_MKRC) != 0)))
109 /* skip global option when only doing locals */
110 if (p->indir == PV_NONE && !(opt_flags & OPT_GLOBAL))
121 *** ../vim-7.1.098/src/version.c Thu Sep 6 14:25:50 2007
122 --- src/version.c Thu Sep 6 16:32:31 2007
126 { /* Add new patch number below this line */
132 Not too long ago, a keyboard was something to make music with...
134 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
135 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
136 \\\ download, build and distribute -- http://www.A-A-P.org ///
137 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///