Mirror of the Vim source from https://github.com/vim/vim
リビジョン | f12d38ee49de595d11efb50674bccfe0417c7063 (tree) |
---|---|
日時 | 2007-06-19 22:36:52 |
作者 | vimboss |
コミッター | vimboss |
updated for version 7.1-006
@@ -171,6 +171,13 @@ | ||
171 | 171 | /* Put the cursor on the first line. */ |
172 | 172 | curwin->w_cursor.lnum = 1; |
173 | 173 | curwin->w_cursor.col = 0; |
174 | + | |
175 | + /* Set or reset 'modified' before executing autocommands, so that | |
176 | + * it can be changed there. */ | |
177 | + if (!readonlymode && !bufempty()) | |
178 | + changed(); | |
179 | + else if (retval != FAIL) | |
180 | + unchanged(curbuf, FALSE); | |
174 | 181 | #ifdef FEAT_AUTOCMD |
175 | 182 | # ifdef FEAT_EVAL |
176 | 183 | apply_autocmds_retval(EVENT_STDINREADPOST, NULL, NULL, FALSE, |
@@ -194,16 +201,16 @@ | ||
194 | 201 | /* When reading stdin, the buffer contents always needs writing, so set |
195 | 202 | * the changed flag. Unless in readonly mode: "ls | gview -". |
196 | 203 | * When interrupted and 'cpoptions' contains 'i' set changed flag. */ |
197 | - if ((read_stdin && !readonlymode && !bufempty()) | |
204 | + if ((got_int && vim_strchr(p_cpo, CPO_INTMOD) != NULL) | |
198 | 205 | #ifdef FEAT_AUTOCMD |
199 | 206 | || modified_was_set /* ":set modified" used in autocmd */ |
200 | 207 | # ifdef FEAT_EVAL |
201 | 208 | || (aborting() && vim_strchr(p_cpo, CPO_INTMOD) != NULL) |
202 | 209 | # endif |
203 | 210 | #endif |
204 | - || (got_int && vim_strchr(p_cpo, CPO_INTMOD) != NULL)) | |
211 | + ) | |
205 | 212 | changed(); |
206 | - else if (retval != FAIL) | |
213 | + else if (retval != FAIL && !read_stdin) | |
207 | 214 | unchanged(curbuf, FALSE); |
208 | 215 | save_file_ff(curbuf); /* keep this fileformat */ |
209 | 216 |
@@ -667,6 +667,8 @@ | ||
667 | 667 | static int included_patches[] = |
668 | 668 | { /* Add new patch number below this line */ |
669 | 669 | /**/ |
670 | + 6, | |
671 | +/**/ | |
670 | 672 | 5, |
671 | 673 | /**/ |
672 | 674 | 4, |