version 1.1, 1996/09/07 21:40:26 |
version 1.2, 1996/09/21 06:23:05 |
|
|
if (gui.starting) |
if (gui.starting) |
{ |
{ |
gui_start(); |
gui_start(); |
gui.starting = FALSE; |
|
full_screen = TRUE; |
full_screen = TRUE; |
} |
} |
#endif |
#endif |
|
|
curbuf->b_p_bin = 1; /* binary file I/O */ |
curbuf->b_p_bin = 1; /* binary file I/O */ |
} |
} |
|
|
|
/* |
|
* "-e errorfile": Load the error file now. |
|
* If the error file can't be read, exit before doing anything else. |
|
*/ |
|
if (doqf && qf_init() == FAIL) /* if reading error file fails: exit */ |
|
{ |
|
outchar('\n'); |
|
mch_windexit(3); |
|
} |
|
|
/* Don't set the file name if there was a command in .vimrc that already |
/* Don't set the file name if there was a command in .vimrc that already |
* loaded the file */ |
* loaded the file */ |
if (curbuf->b_filename == NULL) |
if (curbuf->b_filename == NULL) |
|
|
window_count = 1; |
window_count = 1; |
|
|
/* |
/* |
* "-e errorfile": Load the error file now. |
|
* If the error file can't be read, exit before doing anything else. |
|
*/ |
|
if (doqf && qf_init() == FAIL) /* if reading error file fails: exit */ |
|
mch_windexit(3); |
|
|
|
/* |
|
* Start putting things on the screen. |
* Start putting things on the screen. |
* Scroll screen down before drawing over it |
* Scroll screen down before drawing over it |
* Clear screen now, so file message will not be cleared. |
* Clear screen now, so file message will not be cleared. |
|
|
msg_scroll = FALSE; |
msg_scroll = FALSE; |
if (curbuf->b_ml.ml_mfp == NULL) /* failed */ |
if (curbuf->b_ml.ml_mfp == NULL) /* failed */ |
getout(1); |
getout(1); |
|
do_modelines(); /* do modelines */ |
|
} |
|
else |
|
{ |
|
/* |
|
* Open a buffer for windows that don't have one yet. |
|
* Commands in the .vimrc might have loaded a file or split the window. |
|
* Watch out for autocommands that delete a window. |
|
*/ |
#ifdef AUTOCMD |
#ifdef AUTOCMD |
apply_autocmds(EVENT_BUFENTER, NULL, NULL); |
/* |
|
* Don't execute Win/Buf Enter/Leave autocommands here |
|
*/ |
|
++autocmd_no_enter; |
|
++autocmd_no_leave; |
#endif |
#endif |
do_modelines(); /* do modelines */ |
for (curwin = firstwin; curwin != NULL; curwin = curwin->w_next) |
|
{ |
|
curbuf = curwin->w_buffer; |
|
if (curbuf->b_ml.ml_mfp == NULL) |
|
{ |
|
(void)open_buffer(); /* create memfile and read file */ |
|
#ifdef AUTOCMD |
|
curwin = firstwin; /* start again */ |
|
#endif |
|
} |
|
mch_breakcheck(); |
|
if (got_int) |
|
{ |
|
(void)vgetc(); /* only break the file loading, not the rest */ |
|
break; |
|
} |
|
} |
|
#ifdef AUTOCMD |
|
--autocmd_no_enter; |
|
--autocmd_no_leave; |
|
#endif |
|
curwin = firstwin; |
|
curbuf = curwin->w_buffer; |
} |
} |
/* Only read the file if there is none for the current buffer, a command |
|
* in the .vimrc might have loaded a file */ |
|
else if (curbuf->b_ml.ml_mfp == NULL) |
|
(void)open_buffer(); /* create memfile and read file */ |
|
|
|
|
#ifdef AUTOCMD |
|
apply_autocmds(EVENT_BUFENTER, NULL, NULL); |
|
#endif |
setpcmark(); |
setpcmark(); |
|
|
/* |
/* |
* When started with "-e errorfile" jump to first error now. |
* When started with "-e errorfile" jump to first error now. |
*/ |
*/ |
if (doqf) |
if (doqf) |
qf_jump(0, 0); |
qf_jump(0, 0, FALSE); |
|
|
/* |
/* |
* If opened more than one window, start editing files in the other windows. |
* If opened more than one window, start editing files in the other windows. |
* Make_windows() has already opened the windows. |
* Make_windows() has already opened the windows. |
*/ |
*/ |
|
#ifdef AUTOCMD |
|
/* |
|
* Don't execute Win/Buf Enter/Leave autocommands here |
|
*/ |
|
++autocmd_no_enter; |
|
++autocmd_no_leave; |
|
#endif |
for (i = 1; i < window_count; ++i) |
for (i = 1; i < window_count; ++i) |
{ |
{ |
if (curwin->w_next == NULL) /* just checking */ |
if (curwin->w_next == NULL) /* just checking */ |
|
|
curwin->w_arg_idx = arg_idx; |
curwin->w_arg_idx = arg_idx; |
/* edit file from arg list, if there is one */ |
/* edit file from arg list, if there is one */ |
(void)do_ecmd(0, arg_idx < arg_count ? arg_files[arg_idx] : NULL, |
(void)do_ecmd(0, arg_idx < arg_count ? arg_files[arg_idx] : NULL, |
NULL, NULL, TRUE, (linenr_t)1, FALSE); |
NULL, NULL, (linenr_t)1, ECMD_HIDE); |
if (arg_idx == arg_count - 1) |
if (arg_idx == arg_count - 1) |
arg_had_last = TRUE; |
arg_had_last = TRUE; |
++arg_idx; |
++arg_idx; |
|
|
break; |
break; |
} |
} |
} |
} |
|
#ifdef AUTOCMD |
|
--autocmd_no_enter; |
|
#endif |
win_enter(firstwin, FALSE); /* back to first window */ |
win_enter(firstwin, FALSE); /* back to first window */ |
|
#ifdef AUTOCMD |
|
--autocmd_no_leave; |
|
#endif |
if (window_count > 1) |
if (window_count > 1) |
win_equal(curwin, FALSE); /* adjust heights */ |
win_equal(curwin, FALSE); /* adjust heights */ |
|
|
|
|
#endif |
#endif |
|
|
#ifdef VIMINFO |
#ifdef VIMINFO |
|
msg_didany = FALSE; |
/* Write out the registers, history, marks etc, to the viminfo file */ |
/* Write out the registers, history, marks etc, to the viminfo file */ |
if (*p_viminfo != NUL) |
if (*p_viminfo != NUL) |
write_viminfo(NULL, FALSE); |
write_viminfo(NULL, FALSE); |
|
if (msg_didany) /* make the user read the error message */ |
|
{ |
|
no_wait_return = FALSE; |
|
wait_return(FALSE); |
|
} |
#endif /* VIMINFO */ |
#endif /* VIMINFO */ |
|
|
outchar('\r'); |
|
outchar('\n'); |
|
mch_windexit(r); |
mch_windexit(r); |
} |
} |