Mirror of the Vim source from https://github.com/vim/vim
修訂 | 5ef53a1677ee9c831d7a18ee44d1041f182a82b2 (tree) |
---|---|
時間 | 2007-09-06 23:35:35 |
作者 | vimboss |
Commiter | vimboss |
updated for version 7.1-099
@@ -427,6 +427,8 @@ | ||
427 | 427 | #define P_NOGLOB 0x100000L/* do not use local value for global vimrc */ |
428 | 428 | #define P_NFNAME 0x200000L/* only normal file name chars allowed */ |
429 | 429 | #define P_INSECURE 0x400000L/* option was set from a modeline */ |
430 | +#define P_PRI_MKRC 0x800000L/* priority for :mkvimrc (setting option has | |
431 | + side effects) */ | |
430 | 432 | |
431 | 433 | #define ISK_LATIN1 (char_u *)"@,48-57,_,192-255" |
432 | 434 |
@@ -773,6 +775,8 @@ | ||
773 | 775 | {(char_u *)0L, (char_u *)0L} |
774 | 776 | #endif |
775 | 777 | }, |
778 | + /* P_PRI_MKRC isn't needed here, optval_default() | |
779 | + * always returns TRUE for 'compatible' */ | |
776 | 780 | {"compatible", "cp", P_BOOL|P_RALL, |
777 | 781 | (char_u *)&p_cp, PV_NONE, |
778 | 782 | {(char_u *)TRUE, (char_u *)FALSE}}, |
@@ -1515,7 +1519,7 @@ | ||
1515 | 1519 | {(char_u *)0L, (char_u *)0L} |
1516 | 1520 | #endif |
1517 | 1521 | }, |
1518 | - {"keymap", "kmp", P_STRING|P_ALLOCED|P_VI_DEF|P_RBUF|P_RSTAT|P_NFNAME, | |
1522 | + {"keymap", "kmp", P_STRING|P_ALLOCED|P_VI_DEF|P_RBUF|P_RSTAT|P_NFNAME|P_PRI_MKRC, | |
1519 | 1523 | #ifdef FEAT_KEYMAP |
1520 | 1524 | (char_u *)&p_keymap, PV_KMAP, |
1521 | 1525 | {(char_u *)"", (char_u *)0L} |
@@ -1836,7 +1840,7 @@ | ||
1836 | 1840 | {"paragraphs", "para", P_STRING|P_VI_DEF, |
1837 | 1841 | (char_u *)&p_para, PV_NONE, |
1838 | 1842 | {(char_u *)"IPLPPPQPP LIpplpipbp", (char_u *)0L}}, |
1839 | - {"paste", NULL, P_BOOL|P_VI_DEF, | |
1843 | + {"paste", NULL, P_BOOL|P_VI_DEF|P_PRI_MKRC, | |
1840 | 1844 | (char_u *)&p_paste, PV_NONE, |
1841 | 1845 | {(char_u *)FALSE, (char_u *)0L}}, |
1842 | 1846 | {"pastetoggle", "pt", P_STRING|P_VI_DEF, |
@@ -8535,13 +8539,20 @@ | ||
8535 | 8539 | char_u *varp_local = NULL; /* fresh value */ |
8536 | 8540 | char *cmd; |
8537 | 8541 | int round; |
8542 | + int pri; | |
8538 | 8543 | |
8539 | 8544 | /* |
8540 | 8545 | * The options that don't have a default (terminal name, columns, lines) |
8541 | 8546 | * are never written. Terminal options are also not written. |
8547 | + * Do the loop over "options[]" twice: once for options with the | |
8548 | + * P_PRI_MKRC flag and once without. | |
8542 | 8549 | */ |
8543 | - for (p = &options[0]; !istermoption(p); p++) | |
8544 | - if (!(p->flags & P_NO_MKRC) && !istermoption(p)) | |
8550 | + for (pri = 1; pri >= 0; --pri) | |
8551 | + { | |
8552 | + for (p = &options[0]; !istermoption(p); p++) | |
8553 | + if (!(p->flags & P_NO_MKRC) | |
8554 | + && !istermoption(p) | |
8555 | + && ((pri == 1) == ((p->flags & P_PRI_MKRC) != 0))) | |
8545 | 8556 | { |
8546 | 8557 | /* skip global option when only doing locals */ |
8547 | 8558 | if (p->indir == PV_NONE && !(opt_flags & OPT_GLOBAL)) |
@@ -8637,6 +8648,7 @@ | ||
8637 | 8648 | } |
8638 | 8649 | } |
8639 | 8650 | } |
8651 | + } | |
8640 | 8652 | return OK; |
8641 | 8653 | } |
8642 | 8654 |
@@ -667,6 +667,8 @@ | ||
667 | 667 | static int included_patches[] = |
668 | 668 | { /* Add new patch number below this line */ |
669 | 669 | /**/ |
670 | + 99, | |
671 | +/**/ | |
670 | 672 | 98, |
671 | 673 | /**/ |
672 | 674 | 97, |