mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
updated for version 7.2-215
This commit is contained in:
parent
8d3b8c4a8a
commit
f061e0befb
14
src/fileio.c
14
src/fileio.c
@ -710,7 +710,8 @@ readfile(fname, sfname, from, lines_to_skip, lines_to_read, eap, flags)
|
|||||||
#endif
|
#endif
|
||||||
#ifdef UNIX
|
#ifdef UNIX
|
||||||
/* Set swap file protection bits after creating it. */
|
/* Set swap file protection bits after creating it. */
|
||||||
if (swap_mode > 0 && curbuf->b_ml.ml_mfp->mf_fname != NULL)
|
if (swap_mode > 0 && curbuf->b_ml.ml_mfp != NULL
|
||||||
|
&& curbuf->b_ml.ml_mfp->mf_fname != NULL)
|
||||||
(void)mch_setperm(curbuf->b_ml.ml_mfp->mf_fname, (long)swap_mode);
|
(void)mch_setperm(curbuf->b_ml.ml_mfp->mf_fname, (long)swap_mode);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -8435,9 +8436,9 @@ aucmd_prepbuf(aco, buf)
|
|||||||
* effects, insert it in a the current tab page.
|
* effects, insert it in a the current tab page.
|
||||||
* Anything related to a window (e.g., setting folds) may have
|
* Anything related to a window (e.g., setting folds) may have
|
||||||
* unexpected results. */
|
* unexpected results. */
|
||||||
curwin = aucmd_win;
|
aucmd_win->w_buffer = buf;
|
||||||
curwin->w_buffer = buf;
|
|
||||||
++buf->b_nwindows;
|
++buf->b_nwindows;
|
||||||
|
win_init_empty(aucmd_win); /* set cursor and topline to safe values */
|
||||||
|
|
||||||
#ifdef FEAT_WINDOWS
|
#ifdef FEAT_WINDOWS
|
||||||
/* Split the current window, put the aucmd_win in the upper half. */
|
/* Split the current window, put the aucmd_win in the upper half. */
|
||||||
@ -8448,12 +8449,7 @@ aucmd_prepbuf(aco, buf)
|
|||||||
(void)win_comp_pos(); /* recompute window positions */
|
(void)win_comp_pos(); /* recompute window positions */
|
||||||
p_ea = save_ea;
|
p_ea = save_ea;
|
||||||
#endif
|
#endif
|
||||||
/* set cursor and topline to safe values */
|
curwin = aucmd_win;
|
||||||
curwin_init();
|
|
||||||
#ifdef FEAT_VERTSPLIT
|
|
||||||
curwin->w_wincol = 0;
|
|
||||||
curwin->w_width = Columns;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
curbuf = buf;
|
curbuf = buf;
|
||||||
aco->new_curwin = curwin;
|
aco->new_curwin = curwin;
|
||||||
|
@ -14,6 +14,7 @@ void win_free_all __ARGS((void));
|
|||||||
win_T *winframe_remove __ARGS((win_T *win, int *dirp, tabpage_T *tp));
|
win_T *winframe_remove __ARGS((win_T *win, int *dirp, tabpage_T *tp));
|
||||||
void close_others __ARGS((int message, int forceit));
|
void close_others __ARGS((int message, int forceit));
|
||||||
void curwin_init __ARGS((void));
|
void curwin_init __ARGS((void));
|
||||||
|
void win_init_empty __ARGS((win_T *wp));
|
||||||
int win_alloc_first __ARGS((void));
|
int win_alloc_first __ARGS((void));
|
||||||
void win_alloc_aucmd_win __ARGS((void));
|
void win_alloc_aucmd_win __ARGS((void));
|
||||||
void win_init_size __ARGS((void));
|
void win_init_size __ARGS((void));
|
||||||
|
@ -3411,14 +3411,15 @@ load_dummy_buffer(fname)
|
|||||||
/* Init the options. */
|
/* Init the options. */
|
||||||
buf_copy_options(newbuf, BCO_ENTER | BCO_NOHELP);
|
buf_copy_options(newbuf, BCO_ENTER | BCO_NOHELP);
|
||||||
|
|
||||||
|
/* need to open the memfile before putting the buffer in a window */
|
||||||
|
if (ml_open(newbuf) == OK)
|
||||||
|
{
|
||||||
/* set curwin/curbuf to buf and save a few things */
|
/* set curwin/curbuf to buf and save a few things */
|
||||||
aucmd_prepbuf(&aco, newbuf);
|
aucmd_prepbuf(&aco, newbuf);
|
||||||
|
|
||||||
/* Need to set the filename for autocommands. */
|
/* Need to set the filename for autocommands. */
|
||||||
(void)setfname(curbuf, fname, NULL, FALSE);
|
(void)setfname(curbuf, fname, NULL, FALSE);
|
||||||
|
|
||||||
if (ml_open(curbuf) == OK)
|
|
||||||
{
|
|
||||||
/* Create swap file now to avoid the ATTENTION message. */
|
/* Create swap file now to avoid the ATTENTION message. */
|
||||||
check_need_swap(TRUE);
|
check_need_swap(TRUE);
|
||||||
|
|
||||||
@ -3441,10 +3442,10 @@ load_dummy_buffer(fname)
|
|||||||
newbuf = curbuf;
|
newbuf = curbuf;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/* restore curwin/curbuf and a few other things */
|
/* restore curwin/curbuf and a few other things */
|
||||||
aucmd_restbuf(&aco);
|
aucmd_restbuf(&aco);
|
||||||
|
}
|
||||||
|
|
||||||
if (!buf_valid(newbuf))
|
if (!buf_valid(newbuf))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -676,6 +676,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
215,
|
||||||
/**/
|
/**/
|
||||||
214,
|
214,
|
||||||
/**/
|
/**/
|
||||||
|
60
src/window.c
60
src/window.c
@ -2354,13 +2354,6 @@ win_free_mem(win, dirp, tp)
|
|||||||
frame_T *frp;
|
frame_T *frp;
|
||||||
win_T *wp;
|
win_T *wp;
|
||||||
|
|
||||||
#ifdef FEAT_FOLDING
|
|
||||||
clearFolding(win);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* reduce the reference count to the argument list. */
|
|
||||||
alist_unlink(win->w_alist);
|
|
||||||
|
|
||||||
/* Remove the window and its frame from the tree of frames. */
|
/* Remove the window and its frame from the tree of frames. */
|
||||||
frp = win->w_frame;
|
frp = win->w_frame;
|
||||||
wp = winframe_remove(win, dirp, tp);
|
wp = winframe_remove(win, dirp, tp);
|
||||||
@ -2386,9 +2379,6 @@ win_free_all()
|
|||||||
tabpage_close(TRUE);
|
tabpage_close(TRUE);
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
while (firstwin != NULL)
|
|
||||||
(void)win_free_mem(firstwin, &dummy, NULL);
|
|
||||||
|
|
||||||
# ifdef FEAT_AUTOCMD
|
# ifdef FEAT_AUTOCMD
|
||||||
if (aucmd_win != NULL)
|
if (aucmd_win != NULL)
|
||||||
{
|
{
|
||||||
@ -2396,6 +2386,9 @@ win_free_all()
|
|||||||
aucmd_win = NULL;
|
aucmd_win = NULL;
|
||||||
}
|
}
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
while (firstwin != NULL)
|
||||||
|
(void)win_free_mem(firstwin, &dummy, NULL);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -3204,27 +3197,34 @@ close_others(message, forceit)
|
|||||||
void
|
void
|
||||||
curwin_init()
|
curwin_init()
|
||||||
{
|
{
|
||||||
redraw_win_later(curwin, NOT_VALID);
|
win_init_empty(curwin);
|
||||||
curwin->w_lines_valid = 0;
|
}
|
||||||
curwin->w_cursor.lnum = 1;
|
|
||||||
curwin->w_curswant = curwin->w_cursor.col = 0;
|
void
|
||||||
|
win_init_empty(wp)
|
||||||
|
win_T *wp;
|
||||||
|
{
|
||||||
|
redraw_win_later(wp, NOT_VALID);
|
||||||
|
wp->w_lines_valid = 0;
|
||||||
|
wp->w_cursor.lnum = 1;
|
||||||
|
wp->w_curswant = wp->w_cursor.col = 0;
|
||||||
#ifdef FEAT_VIRTUALEDIT
|
#ifdef FEAT_VIRTUALEDIT
|
||||||
curwin->w_cursor.coladd = 0;
|
wp->w_cursor.coladd = 0;
|
||||||
#endif
|
#endif
|
||||||
curwin->w_pcmark.lnum = 1; /* pcmark not cleared but set to line 1 */
|
wp->w_pcmark.lnum = 1; /* pcmark not cleared but set to line 1 */
|
||||||
curwin->w_pcmark.col = 0;
|
wp->w_pcmark.col = 0;
|
||||||
curwin->w_prev_pcmark.lnum = 0;
|
wp->w_prev_pcmark.lnum = 0;
|
||||||
curwin->w_prev_pcmark.col = 0;
|
wp->w_prev_pcmark.col = 0;
|
||||||
curwin->w_topline = 1;
|
wp->w_topline = 1;
|
||||||
#ifdef FEAT_DIFF
|
#ifdef FEAT_DIFF
|
||||||
curwin->w_topfill = 0;
|
wp->w_topfill = 0;
|
||||||
#endif
|
#endif
|
||||||
curwin->w_botline = 2;
|
wp->w_botline = 2;
|
||||||
#ifdef FEAT_FKMAP
|
#ifdef FEAT_FKMAP
|
||||||
if (curwin->w_p_rl)
|
if (wp->w_p_rl)
|
||||||
curwin->w_farsi = W_CONV + W_R_L;
|
wp->w_farsi = W_CONV + W_R_L;
|
||||||
else
|
else
|
||||||
curwin->w_farsi = W_CONV;
|
wp->w_farsi = W_CONV;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4325,6 +4325,13 @@ win_free(wp, tp)
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
#ifdef FEAT_FOLDING
|
||||||
|
clearFolding(wp);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* reduce the reference count to the argument list. */
|
||||||
|
alist_unlink(wp->w_alist);
|
||||||
|
|
||||||
#ifdef FEAT_AUTOCMD
|
#ifdef FEAT_AUTOCMD
|
||||||
/* Don't execute autocommands while the window is halfway being deleted.
|
/* Don't execute autocommands while the window is halfway being deleted.
|
||||||
* gui_mch_destroy_scrollbar() may trigger a FocusGained event. */
|
* gui_mch_destroy_scrollbar() may trigger a FocusGained event. */
|
||||||
@ -4387,6 +4394,9 @@ win_free(wp, tp)
|
|||||||
}
|
}
|
||||||
#endif /* FEAT_GUI */
|
#endif /* FEAT_GUI */
|
||||||
|
|
||||||
|
#ifdef FEAT_AUTOCMD
|
||||||
|
if (wp != aucmd_win)
|
||||||
|
#endif
|
||||||
win_remove(wp, tp);
|
win_remove(wp, tp);
|
||||||
vim_free(wp);
|
vim_free(wp);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user