Mercurial > vim
comparison src/fileio.c @ 694:07d199fe02ed v7.0209
updated for version 7.0209
author | vimboss |
---|---|
date | Mon, 27 Feb 2006 23:58:35 +0000 |
parents | 9364d114ed8d |
children | f0a9ef4db025 |
comparison
equal
deleted
inserted
replaced
693:05dc93b9c61f | 694:07d199fe02ed |
---|---|
581 if (eap != NULL && eap->force_enc != 0) | 581 if (eap != NULL && eap->force_enc != 0) |
582 { | 582 { |
583 /* set forced 'fileencoding' */ | 583 /* set forced 'fileencoding' */ |
584 fenc = enc_canonize(eap->cmd + eap->force_enc); | 584 fenc = enc_canonize(eap->cmd + eap->force_enc); |
585 if (fenc != NULL) | 585 if (fenc != NULL) |
586 { | |
587 set_string_option_direct((char_u *)"fenc", -1, | 586 set_string_option_direct((char_u *)"fenc", -1, |
588 fenc, OPT_FREE|OPT_LOCAL); | 587 fenc, OPT_FREE|OPT_LOCAL, 0); |
589 # ifdef FEAT_EVAL | |
590 set_option_scriptID((char_u *)"fenc", current_SID); | |
591 # endif | |
592 } | |
593 vim_free(fenc); | 588 vim_free(fenc); |
594 } | 589 } |
595 #endif | 590 #endif |
596 #ifdef FEAT_AUTOCMD | 591 #ifdef FEAT_AUTOCMD |
597 apply_autocmds_exarg(EVENT_BUFNEWFILE, sfname, sfname, | 592 apply_autocmds_exarg(EVENT_BUFNEWFILE, sfname, sfname, |
2111 #endif | 2106 #endif |
2112 | 2107 |
2113 #ifdef FEAT_MBYTE | 2108 #ifdef FEAT_MBYTE |
2114 /* If editing a new file: set 'fenc' for the current buffer. */ | 2109 /* If editing a new file: set 'fenc' for the current buffer. */ |
2115 if (newfile) | 2110 if (newfile) |
2116 { | |
2117 set_string_option_direct((char_u *)"fenc", -1, fenc, | 2111 set_string_option_direct((char_u *)"fenc", -1, fenc, |
2118 OPT_FREE|OPT_LOCAL); | 2112 OPT_FREE|OPT_LOCAL, 0); |
2119 # ifdef FEAT_EVAL | |
2120 set_option_scriptID((char_u *)"fenc", current_SID); | |
2121 # endif | |
2122 } | |
2123 if (fenc_alloced) | 2113 if (fenc_alloced) |
2124 vim_free(fenc); | 2114 vim_free(fenc); |
2125 # ifdef USE_ICONV | 2115 # ifdef USE_ICONV |
2126 if (iconv_fd != (iconv_t)-1) | 2116 if (iconv_fd != (iconv_t)-1) |
2127 { | 2117 { |
7501 { | 7491 { |
7502 new_ei = vim_strnsave(p_ei, (int)(STRLEN(p_ei) + STRLEN(what))); | 7492 new_ei = vim_strnsave(p_ei, (int)(STRLEN(p_ei) + STRLEN(what))); |
7503 if (new_ei != NULL) | 7493 if (new_ei != NULL) |
7504 { | 7494 { |
7505 STRCAT(new_ei, what); | 7495 STRCAT(new_ei, what); |
7506 set_string_option_direct((char_u *)"ei", -1, new_ei, OPT_FREE); | 7496 set_string_option_direct((char_u *)"ei", -1, new_ei, |
7497 OPT_FREE, SID_NONE); | |
7507 vim_free(new_ei); | 7498 vim_free(new_ei); |
7508 } | 7499 } |
7509 } | 7500 } |
7510 return save_ei; | 7501 return save_ei; |
7511 } | 7502 } |
7514 au_event_restore(old_ei) | 7505 au_event_restore(old_ei) |
7515 char_u *old_ei; | 7506 char_u *old_ei; |
7516 { | 7507 { |
7517 if (old_ei != NULL) | 7508 if (old_ei != NULL) |
7518 { | 7509 { |
7519 set_string_option_direct((char_u *)"ei", -1, old_ei, OPT_FREE); | 7510 set_string_option_direct((char_u *)"ei", -1, old_ei, |
7511 OPT_FREE, SID_NONE); | |
7520 vim_free(old_ei); | 7512 vim_free(old_ei); |
7521 } | 7513 } |
7522 } | 7514 } |
7523 # endif /* FEAT_SYN_HL */ | 7515 # endif /* FEAT_SYN_HL */ |
7524 | 7516 |