diff options
author | Bram Moolenaar <Bram@vim.org> | 2006-04-05 20:41:53 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2006-04-05 20:41:53 +0000 |
commit | 910f66f90c928da8b607ccfdc12fc33d9cb8d4a9 (patch) | |
tree | 152a03d1d7ea3e8d433addba4f463d8a7a68a5fd /src/option.c | |
parent | e2f98b95c8071f772695602cd4f714dc588eb8e7 (diff) | |
download | vim-git-910f66f90c928da8b607ccfdc12fc33d9cb8d4a9.tar.gz |
updated for version 7.0c10v7.0c10
Diffstat (limited to 'src/option.c')
-rw-r--r-- | src/option.c | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/src/option.c b/src/option.c index e0cfa137a..2f7e90ae2 100644 --- a/src/option.c +++ b/src/option.c @@ -430,9 +430,8 @@ struct vimoption #define ISK_LATIN1 (char_u *)"@,48-57,_,192-255" -/* 'isprint' for latin1 is also used for MS-Windows, where 0x80 is used for - * the currency sign. This isn't really latin1 but Windows-1252, but we can't - * detect that. */ +/* 'isprint' for latin1 is also used for MS-Windows cp1252, where 0x80 is used + * for the currency sign. */ #if defined(MSDOS) || defined(MSWIN) || defined(OS2) # define ISP_LATIN1 (char_u *)"@,~-255" #else @@ -6727,6 +6726,8 @@ set_chars_option(varp) s = p + len + 1; #ifdef FEAT_MBYTE c1 = mb_ptr2char_adv(&s); + if (mb_char2cells(c1) > 1) + continue; #else c1 = *s++; #endif @@ -6736,6 +6737,8 @@ set_chars_option(varp) continue; #ifdef FEAT_MBYTE c2 = mb_ptr2char_adv(&s); + if (mb_char2cells(c2) > 1) + continue; #else c2 = *s++; #endif @@ -10241,11 +10244,16 @@ paste_option_changed() * Reset 'compatible' and set the values for options that didn't get set yet * to the Vim defaults. * Don't do this if the 'compatible' option has been set or reset before. + * When "fname" is not NULL, use it to set $"envname" when it wasn't set yet. */ void -vimrc_found() +vimrc_found(fname, envname) + char_u *fname; + char_u *envname; { - int opt_idx; + int opt_idx; + int dofree; + char_u *p; if (!option_was_set((char_u *)"cp")) { @@ -10255,6 +10263,23 @@ vimrc_found() set_option_default(opt_idx, OPT_FREE, FALSE); didset_options(); } + + if (fname != NULL) + { + p = vim_getenv(envname, &dofree); + if (p == NULL) + { + /* Set $MYVIMRC to the first vimrc file found. */ + p = FullName_save(fname, FALSE); + if (p != NULL) + { + vim_setenv(envname, p); + vim_free(p); + } + } + else if (dofree) + vim_free(p); + } } /* |