comparison src/fileio.c @ 161:6df0106fc595

updated for version 7.0049
author vimboss
date Mon, 07 Feb 2005 22:01:03 +0000
parents 19670b05ee32
children 8b0ee9d57d7f
comparison
equal deleted inserted replaced
160:7c0820eed232 161:6df0106fc595
2699 int buf_sfname = FALSE; 2699 int buf_sfname = FALSE;
2700 int buf_fname_f = FALSE; 2700 int buf_fname_f = FALSE;
2701 int buf_fname_s = FALSE; 2701 int buf_fname_s = FALSE;
2702 int did_cmd = FALSE; 2702 int did_cmd = FALSE;
2703 int nofile_err = FALSE; 2703 int nofile_err = FALSE;
2704 int empty_memline = (buf->b_ml.ml_mfp == NULL);
2704 2705
2705 /* 2706 /*
2706 * Apply PRE aucocommands. 2707 * Apply PRE aucocommands.
2707 * Set curbuf to the buffer to be written. 2708 * Set curbuf to the buffer to be written.
2708 * Careful: The autocommands may call buf_write() recursively! 2709 * Careful: The autocommands may call buf_write() recursively!
2770 * 2. The autocommands abort script processing. 2771 * 2. The autocommands abort script processing.
2771 * 3. If one of the "Cmd" autocommands was executed. 2772 * 3. If one of the "Cmd" autocommands was executed.
2772 */ 2773 */
2773 if (!buf_valid(buf)) 2774 if (!buf_valid(buf))
2774 buf = NULL; 2775 buf = NULL;
2775 if (buf == NULL || buf->b_ml.ml_mfp == NULL 2776 if (buf == NULL || (buf->b_ml.ml_mfp == NULL && !empty_memline)
2776 || did_cmd || nofile_err || aborting()) 2777 || did_cmd || nofile_err || aborting())
2777 { 2778 {
2778 --no_wait_return; 2779 --no_wait_return;
2779 msg_scroll = msg_save; 2780 msg_scroll = msg_save;
2780 if (nofile_err) 2781 if (nofile_err)
6648 {"FuncUndefined", EVENT_FUNCUNDEFINED}, 6649 {"FuncUndefined", EVENT_FUNCUNDEFINED},
6649 {"GUIEnter", EVENT_GUIENTER}, 6650 {"GUIEnter", EVENT_GUIENTER},
6650 {"InsertChange", EVENT_INSERTCHANGE}, 6651 {"InsertChange", EVENT_INSERTCHANGE},
6651 {"InsertEnter", EVENT_INSERTENTER}, 6652 {"InsertEnter", EVENT_INSERTENTER},
6652 {"InsertLeave", EVENT_INSERTLEAVE}, 6653 {"InsertLeave", EVENT_INSERTLEAVE},
6654 {"QuickFixCmdPost", EVENT_QUICKFIXCMDPOST},
6655 {"QuickFixCmdPre", EVENT_QUICKFIXCMDPRE},
6653 {"RemoteReply", EVENT_REMOTEREPLY}, 6656 {"RemoteReply", EVENT_REMOTEREPLY},
6654 {"StdinReadPost", EVENT_STDINREADPOST}, 6657 {"StdinReadPost", EVENT_STDINREADPOST},
6655 {"StdinReadPre", EVENT_STDINREADPRE}, 6658 {"StdinReadPre", EVENT_STDINREADPRE},
6656 {"Syntax", EVENT_SYNTAX}, 6659 {"Syntax", EVENT_SYNTAX},
6657 {"TermChanged", EVENT_TERMCHANGED}, 6660 {"TermChanged", EVENT_TERMCHANGED},
8040 fname = vim_strsave(fname); /* make a copy, so we can change it */ 8043 fname = vim_strsave(fname); /* make a copy, so we can change it */
8041 } 8044 }
8042 else 8045 else
8043 { 8046 {
8044 sfname = vim_strsave(fname); 8047 sfname = vim_strsave(fname);
8045 /* Don't try expanding FileType, Syntax or WindowID. */ 8048 /* Don't try expanding FileType, Syntax, WindowID or QuickFixCmd* */
8046 if (event == EVENT_FILETYPE || event == EVENT_SYNTAX 8049 if (event == EVENT_FILETYPE
8047 || event == EVENT_REMOTEREPLY) 8050 || event == EVENT_SYNTAX
8051 || event == EVENT_REMOTEREPLY
8052 || event == EVENT_QUICKFIXCMDPRE
8053 || event == EVENT_QUICKFIXCMDPOST)
8048 fname = vim_strsave(fname); 8054 fname = vim_strsave(fname);
8049 else 8055 else
8050 fname = FullName_save(fname, FALSE); 8056 fname = FullName_save(fname, FALSE);
8051 } 8057 }
8052 if (fname == NULL) /* out of memory */ 8058 if (fname == NULL) /* out of memory */