forked from aniani/vim
patch 9.0.0263: too many #ifdefs
Problem: Too many #ifdefs. Solution: Make some functions always available.
This commit is contained in:
53
src/buffer.c
53
src/buffer.c
@@ -222,9 +222,7 @@ open_buffer(
|
|||||||
|
|
||||||
// Read the file if there is one.
|
// Read the file if there is one.
|
||||||
if (curbuf->b_ffname != NULL
|
if (curbuf->b_ffname != NULL
|
||||||
#ifdef FEAT_QUICKFIX
|
|
||||||
&& !bt_quickfix(curbuf)
|
&& !bt_quickfix(curbuf)
|
||||||
#endif
|
|
||||||
&& !bt_nofilename(curbuf)
|
&& !bt_nofilename(curbuf)
|
||||||
#ifdef FEAT_NETBEANS_INTG
|
#ifdef FEAT_NETBEANS_INTG
|
||||||
&& netbeansReadFile
|
&& netbeansReadFile
|
||||||
@@ -1328,11 +1326,7 @@ do_buffer_ext(
|
|||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
#ifdef FEAT_PROP_POPUP
|
#ifdef FEAT_PROP_POPUP
|
||||||
if ((flags & DOBUF_NOPOPUP) && bt_popup(buf)
|
if ((flags & DOBUF_NOPOPUP) && bt_popup(buf) && !bt_terminal(buf))
|
||||||
# ifdef FEAT_TERMINAL
|
|
||||||
&& !bt_terminal(buf)
|
|
||||||
#endif
|
|
||||||
)
|
|
||||||
return OK;
|
return OK;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -1445,11 +1439,7 @@ do_buffer_ext(
|
|||||||
{
|
{
|
||||||
// Skip current and unlisted bufs. Also skip a quickfix
|
// Skip current and unlisted bufs. Also skip a quickfix
|
||||||
// buffer, it might be deleted soon.
|
// buffer, it might be deleted soon.
|
||||||
if (buf == curbuf || !buf->b_p_bl
|
if (buf == curbuf || !buf->b_p_bl || bt_quickfix(buf))
|
||||||
#if defined(FEAT_QUICKFIX)
|
|
||||||
|| bt_quickfix(buf)
|
|
||||||
#endif
|
|
||||||
)
|
|
||||||
buf = NULL;
|
buf = NULL;
|
||||||
else if (buf->b_ml.ml_mfp == NULL)
|
else if (buf->b_ml.ml_mfp == NULL)
|
||||||
{
|
{
|
||||||
@@ -1487,10 +1477,7 @@ do_buffer_ext(
|
|||||||
}
|
}
|
||||||
// in non-help buffer, try to skip help buffers, and vv
|
// in non-help buffer, try to skip help buffers, and vv
|
||||||
if (buf->b_help == curbuf->b_help && buf->b_p_bl
|
if (buf->b_help == curbuf->b_help && buf->b_p_bl
|
||||||
#if defined(FEAT_QUICKFIX)
|
&& !bt_quickfix(buf))
|
||||||
&& !bt_quickfix(buf)
|
|
||||||
#endif
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
if (buf->b_ml.ml_mfp != NULL) // found loaded buffer
|
if (buf->b_ml.ml_mfp != NULL) // found loaded buffer
|
||||||
break;
|
break;
|
||||||
@@ -1508,11 +1495,7 @@ do_buffer_ext(
|
|||||||
if (buf == NULL) // No loaded buffer, find listed one
|
if (buf == NULL) // No loaded buffer, find listed one
|
||||||
{
|
{
|
||||||
FOR_ALL_BUFFERS(buf)
|
FOR_ALL_BUFFERS(buf)
|
||||||
if (buf->b_p_bl && buf != curbuf
|
if (buf->b_p_bl && buf != curbuf && !bt_quickfix(buf))
|
||||||
#if defined(FEAT_QUICKFIX)
|
|
||||||
&& !bt_quickfix(buf)
|
|
||||||
#endif
|
|
||||||
)
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (buf == NULL) // Still no buffer, just take one
|
if (buf == NULL) // Still no buffer, just take one
|
||||||
@@ -1521,10 +1504,8 @@ do_buffer_ext(
|
|||||||
buf = curbuf->b_next;
|
buf = curbuf->b_next;
|
||||||
else
|
else
|
||||||
buf = curbuf->b_prev;
|
buf = curbuf->b_prev;
|
||||||
#if defined(FEAT_QUICKFIX)
|
|
||||||
if (bt_quickfix(buf))
|
if (bt_quickfix(buf))
|
||||||
buf = NULL;
|
buf = NULL;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1987,9 +1968,7 @@ curbuf_reusable(void)
|
|||||||
&& curbuf->b_ffname == NULL
|
&& curbuf->b_ffname == NULL
|
||||||
&& curbuf->b_nwindows <= 1
|
&& curbuf->b_nwindows <= 1
|
||||||
&& (curbuf->b_ml.ml_mfp == NULL || BUFEMPTY())
|
&& (curbuf->b_ml.ml_mfp == NULL || BUFEMPTY())
|
||||||
#if defined(FEAT_QUICKFIX)
|
|
||||||
&& !bt_quickfix(curbuf)
|
&& !bt_quickfix(curbuf)
|
||||||
#endif
|
|
||||||
&& !curbufIsChanged());
|
&& !curbufIsChanged());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3787,15 +3766,9 @@ fileinfo(
|
|||||||
vim_snprintf_add(buffer, IOSIZE, "\"%s%s%s%s%s%s",
|
vim_snprintf_add(buffer, IOSIZE, "\"%s%s%s%s%s%s",
|
||||||
curbufIsChanged() ? (shortmess(SHM_MOD)
|
curbufIsChanged() ? (shortmess(SHM_MOD)
|
||||||
? " [+]" : _(" [Modified]")) : " ",
|
? " [+]" : _(" [Modified]")) : " ",
|
||||||
(curbuf->b_flags & BF_NOTEDITED)
|
(curbuf->b_flags & BF_NOTEDITED) && !bt_dontwrite(curbuf)
|
||||||
#ifdef FEAT_QUICKFIX
|
|
||||||
&& !bt_dontwrite(curbuf)
|
|
||||||
#endif
|
|
||||||
? _("[Not edited]") : "",
|
? _("[Not edited]") : "",
|
||||||
(curbuf->b_flags & BF_NEW)
|
(curbuf->b_flags & BF_NEW) && !bt_dontwrite(curbuf)
|
||||||
#ifdef FEAT_QUICKFIX
|
|
||||||
&& !bt_dontwrite(curbuf)
|
|
||||||
#endif
|
|
||||||
? new_file_message() : "",
|
? new_file_message() : "",
|
||||||
(curbuf->b_flags & BF_READERR) ? _("[Read errors]") : "",
|
(curbuf->b_flags & BF_READERR) ? _("[Read errors]") : "",
|
||||||
curbuf->b_p_ro ? (shortmess(SHM_RO) ? _("[RO]")
|
curbuf->b_p_ro ? (shortmess(SHM_RO) ? _("[RO]")
|
||||||
@@ -5676,27 +5649,31 @@ bt_normal(buf_T *buf)
|
|||||||
return buf != NULL && buf->b_p_bt[0] == NUL;
|
return buf != NULL && buf->b_p_bt[0] == NUL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(FEAT_QUICKFIX) || defined(PROTO)
|
|
||||||
/*
|
/*
|
||||||
* Return TRUE if "buf" is the quickfix buffer.
|
* Return TRUE if "buf" is the quickfix buffer.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
bt_quickfix(buf_T *buf)
|
bt_quickfix(buf_T *buf)
|
||||||
{
|
{
|
||||||
|
#ifdef FEAT_QUICKFIX
|
||||||
return buf != NULL && buf->b_p_bt[0] == 'q';
|
return buf != NULL && buf->b_p_bt[0] == 'q';
|
||||||
}
|
#else
|
||||||
|
return FALSE;
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
#if defined(FEAT_TERMINAL) || defined(PROTO)
|
|
||||||
/*
|
/*
|
||||||
* Return TRUE if "buf" is a terminal buffer.
|
* Return TRUE if "buf" is a terminal buffer.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
bt_terminal(buf_T *buf)
|
bt_terminal(buf_T *buf)
|
||||||
{
|
{
|
||||||
|
#if defined(FEAT_TERMINAL)
|
||||||
return buf != NULL && buf->b_p_bt[0] == 't';
|
return buf != NULL && buf->b_p_bt[0] == 't';
|
||||||
}
|
#else
|
||||||
|
return FALSE;
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Return TRUE if "buf" is a help buffer.
|
* Return TRUE if "buf" is a help buffer.
|
||||||
@@ -5764,7 +5741,6 @@ bt_dontwrite(buf_T *buf)
|
|||||||
|| buf->b_p_bt[0] == 'p');
|
|| buf->b_p_bt[0] == 'p');
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(FEAT_QUICKFIX) || defined(PROTO)
|
|
||||||
int
|
int
|
||||||
bt_dontwrite_msg(buf_T *buf)
|
bt_dontwrite_msg(buf_T *buf)
|
||||||
{
|
{
|
||||||
@@ -5775,7 +5751,6 @@ bt_dontwrite_msg(buf_T *buf)
|
|||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Return TRUE if the buffer should be hidden, according to 'hidden', ":hide"
|
* Return TRUE if the buffer should be hidden, according to 'hidden', ":hide"
|
||||||
|
|||||||
@@ -742,9 +742,7 @@ buf_write(
|
|||||||
&& reset_changed
|
&& reset_changed
|
||||||
&& whole
|
&& whole
|
||||||
&& buf == curbuf
|
&& buf == curbuf
|
||||||
#ifdef FEAT_QUICKFIX
|
|
||||||
&& !bt_nofilename(buf)
|
&& !bt_nofilename(buf)
|
||||||
#endif
|
|
||||||
&& !filtering
|
&& !filtering
|
||||||
&& (!append || vim_strchr(p_cpo, CPO_FNAMEAPP) != NULL)
|
&& (!append || vim_strchr(p_cpo, CPO_FNAMEAPP) != NULL)
|
||||||
&& vim_strchr(p_cpo, CPO_FNAMEW) != NULL)
|
&& vim_strchr(p_cpo, CPO_FNAMEW) != NULL)
|
||||||
@@ -813,11 +811,9 @@ buf_write(
|
|||||||
if (!(did_cmd = apply_autocmds_exarg(EVENT_FILEAPPENDCMD,
|
if (!(did_cmd = apply_autocmds_exarg(EVENT_FILEAPPENDCMD,
|
||||||
sfname, sfname, FALSE, curbuf, eap)))
|
sfname, sfname, FALSE, curbuf, eap)))
|
||||||
{
|
{
|
||||||
#ifdef FEAT_QUICKFIX
|
|
||||||
if (overwriting && bt_nofilename(curbuf))
|
if (overwriting && bt_nofilename(curbuf))
|
||||||
nofile_err = TRUE;
|
nofile_err = TRUE;
|
||||||
else
|
else
|
||||||
#endif
|
|
||||||
apply_autocmds_exarg(EVENT_FILEAPPENDPRE,
|
apply_autocmds_exarg(EVENT_FILEAPPENDPRE,
|
||||||
sfname, sfname, FALSE, curbuf, eap);
|
sfname, sfname, FALSE, curbuf, eap);
|
||||||
}
|
}
|
||||||
@@ -846,11 +842,9 @@ buf_write(
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#ifdef FEAT_QUICKFIX
|
|
||||||
if (overwriting && bt_nofilename(curbuf))
|
if (overwriting && bt_nofilename(curbuf))
|
||||||
nofile_err = TRUE;
|
nofile_err = TRUE;
|
||||||
else
|
else
|
||||||
#endif
|
|
||||||
apply_autocmds_exarg(EVENT_BUFWRITEPRE,
|
apply_autocmds_exarg(EVENT_BUFWRITEPRE,
|
||||||
sfname, sfname, FALSE, curbuf, eap);
|
sfname, sfname, FALSE, curbuf, eap);
|
||||||
}
|
}
|
||||||
@@ -860,11 +854,9 @@ buf_write(
|
|||||||
if (!(did_cmd = apply_autocmds_exarg(EVENT_FILEWRITECMD,
|
if (!(did_cmd = apply_autocmds_exarg(EVENT_FILEWRITECMD,
|
||||||
sfname, sfname, FALSE, curbuf, eap)))
|
sfname, sfname, FALSE, curbuf, eap)))
|
||||||
{
|
{
|
||||||
#ifdef FEAT_QUICKFIX
|
|
||||||
if (overwriting && bt_nofilename(curbuf))
|
if (overwriting && bt_nofilename(curbuf))
|
||||||
nofile_err = TRUE;
|
nofile_err = TRUE;
|
||||||
else
|
else
|
||||||
#endif
|
|
||||||
apply_autocmds_exarg(EVENT_FILEWRITEPRE,
|
apply_autocmds_exarg(EVENT_FILEWRITEPRE,
|
||||||
sfname, sfname, FALSE, curbuf, eap);
|
sfname, sfname, FALSE, curbuf, eap);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -100,11 +100,7 @@ changed(void)
|
|||||||
|
|
||||||
// Create a swap file if that is wanted.
|
// Create a swap file if that is wanted.
|
||||||
// Don't do this for "nofile" and "nowrite" buffer types.
|
// Don't do this for "nofile" and "nowrite" buffer types.
|
||||||
if (curbuf->b_may_swap
|
if (curbuf->b_may_swap && !bt_dontwrite(curbuf))
|
||||||
#ifdef FEAT_QUICKFIX
|
|
||||||
&& !bt_dontwrite(curbuf)
|
|
||||||
#endif
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
int save_need_wait_return = need_wait_return;
|
int save_need_wait_return = need_wait_return;
|
||||||
|
|
||||||
|
|||||||
@@ -482,11 +482,7 @@ win_redr_status(win_T *wp, int ignore_pum UNUSED)
|
|||||||
len += (int)STRLEN(p + len);
|
len += (int)STRLEN(p + len);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (bufIsChanged(wp->w_buffer)
|
if (bufIsChanged(wp->w_buffer) && !bt_terminal(wp->w_buffer))
|
||||||
#ifdef FEAT_TERMINAL
|
|
||||||
&& !bt_terminal(wp->w_buffer)
|
|
||||||
#endif
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
vim_snprintf((char *)p + len, MAXPATHL - len, "%s", "[+]");
|
vim_snprintf((char *)p + len, MAXPATHL - len, "%s", "[+]");
|
||||||
len += (int)STRLEN(p + len);
|
len += (int)STRLEN(p + len);
|
||||||
|
|||||||
@@ -954,9 +954,9 @@ EXTERN char e_at_bottom_of_quickfix_stack[]
|
|||||||
INIT(= N_("E380: At bottom of quickfix stack"));
|
INIT(= N_("E380: At bottom of quickfix stack"));
|
||||||
EXTERN char e_at_top_of_quickfix_stack[]
|
EXTERN char e_at_top_of_quickfix_stack[]
|
||||||
INIT(= N_("E381: At top of quickfix stack"));
|
INIT(= N_("E381: At top of quickfix stack"));
|
||||||
|
#endif
|
||||||
EXTERN char e_cannot_write_buftype_option_is_set[]
|
EXTERN char e_cannot_write_buftype_option_is_set[]
|
||||||
INIT(= N_("E382: Cannot write, 'buftype' option is set"));
|
INIT(= N_("E382: Cannot write, 'buftype' option is set"));
|
||||||
#endif
|
|
||||||
EXTERN char e_invalid_search_string_str[]
|
EXTERN char e_invalid_search_string_str[]
|
||||||
INIT(= N_("E383: Invalid search string: %s"));
|
INIT(= N_("E383: Invalid search string: %s"));
|
||||||
EXTERN char e_search_hit_top_without_match_for_str[]
|
EXTERN char e_search_hit_top_without_match_for_str[]
|
||||||
|
|||||||
@@ -93,11 +93,7 @@ find_buffer(typval_T *avar)
|
|||||||
// buffer, these don't use the full path.
|
// buffer, these don't use the full path.
|
||||||
FOR_ALL_BUFFERS(buf)
|
FOR_ALL_BUFFERS(buf)
|
||||||
if (buf->b_fname != NULL
|
if (buf->b_fname != NULL
|
||||||
&& (path_with_url(buf->b_fname)
|
&& (path_with_url(buf->b_fname) || bt_nofilename(buf))
|
||||||
#ifdef FEAT_QUICKFIX
|
|
||||||
|| bt_nofilename(buf)
|
|
||||||
#endif
|
|
||||||
)
|
|
||||||
&& STRCMP(buf->b_fname, avar->vval.v_string) == 0)
|
&& STRCMP(buf->b_fname, avar->vval.v_string) == 0)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1677,12 +1677,7 @@ append_redir(
|
|||||||
(char *)opt, (char *)fname);
|
(char *)opt, (char *)fname);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
vim_snprintf((char *)end, (size_t)(buflen - (end - buf)),
|
vim_snprintf((char *)end, (size_t)(buflen - (end - buf)), " %s %s",
|
||||||
#ifdef FEAT_QUICKFIX
|
|
||||||
" %s %s",
|
|
||||||
#else
|
|
||||||
" %s%s", // " > %s" causes problems on Amiga
|
|
||||||
#endif
|
|
||||||
(char *)opt, (char *)fname);
|
(char *)opt, (char *)fname);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1947,11 +1942,7 @@ do_write(exarg_T *eap)
|
|||||||
* and a file name is required.
|
* and a file name is required.
|
||||||
* "nofile" and "nowrite" buffers cannot be written implicitly either.
|
* "nofile" and "nowrite" buffers cannot be written implicitly either.
|
||||||
*/
|
*/
|
||||||
if (!other && (
|
if (!other && (bt_dontwrite_msg(curbuf) || check_fname() == FAIL
|
||||||
#ifdef FEAT_QUICKFIX
|
|
||||||
bt_dontwrite_msg(curbuf) ||
|
|
||||||
#endif
|
|
||||||
check_fname() == FAIL
|
|
||||||
#ifdef UNIX
|
#ifdef UNIX
|
||||||
|| check_writable(curbuf->b_ffname) == FAIL
|
|| check_writable(curbuf->b_ffname) == FAIL
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -27,10 +27,8 @@ autowrite(buf_T *buf, int forceit)
|
|||||||
bufref_T bufref;
|
bufref_T bufref;
|
||||||
|
|
||||||
if (!(p_aw || p_awa) || !p_write
|
if (!(p_aw || p_awa) || !p_write
|
||||||
#ifdef FEAT_QUICKFIX
|
|
||||||
// never autowrite a "nofile" or "nowrite" buffer
|
// never autowrite a "nofile" or "nowrite" buffer
|
||||||
|| bt_dontwrite(buf)
|
|| bt_dontwrite(buf)
|
||||||
#endif
|
|
||||||
|| (!forceit && buf->b_p_ro) || buf->b_ffname == NULL)
|
|| (!forceit && buf->b_p_ro) || buf->b_ffname == NULL)
|
||||||
return FAIL;
|
return FAIL;
|
||||||
set_bufref(&bufref, buf);
|
set_bufref(&bufref, buf);
|
||||||
|
|||||||
@@ -55,8 +55,6 @@ static int getargopt(exarg_T *eap);
|
|||||||
# define qf_history ex_ni
|
# define qf_history ex_ni
|
||||||
# define ex_helpgrep ex_ni
|
# define ex_helpgrep ex_ni
|
||||||
# define ex_vimgrep ex_ni
|
# define ex_vimgrep ex_ni
|
||||||
#endif
|
|
||||||
#if !defined(FEAT_QUICKFIX)
|
|
||||||
# define ex_cclose ex_ni
|
# define ex_cclose ex_ni
|
||||||
# define ex_copen ex_ni
|
# define ex_copen ex_ni
|
||||||
# define ex_cwindow ex_ni
|
# define ex_cwindow ex_ni
|
||||||
|
|||||||
@@ -514,9 +514,7 @@ readfile(
|
|||||||
// Create a swap file now, so that other Vims are warned
|
// Create a swap file now, so that other Vims are warned
|
||||||
// that we are editing this file. Don't do this for a
|
// that we are editing this file. Don't do this for a
|
||||||
// "nofile" or "nowrite" buffer type.
|
// "nofile" or "nowrite" buffer type.
|
||||||
#ifdef FEAT_QUICKFIX
|
|
||||||
if (!bt_dontwrite(curbuf))
|
if (!bt_dontwrite(curbuf))
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
check_need_swap(newfile);
|
check_need_swap(newfile);
|
||||||
// SwapExists autocommand may mess things up
|
// SwapExists autocommand may mess things up
|
||||||
@@ -595,9 +593,7 @@ readfile(
|
|||||||
// Create a swap file now, so that other Vims are warned that we are
|
// Create a swap file now, so that other Vims are warned that we are
|
||||||
// editing this file.
|
// editing this file.
|
||||||
// Don't do this for a "nofile" or "nowrite" buffer type.
|
// Don't do this for a "nofile" or "nowrite" buffer type.
|
||||||
#ifdef FEAT_QUICKFIX
|
|
||||||
if (!bt_dontwrite(curbuf))
|
if (!bt_dontwrite(curbuf))
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
check_need_swap(newfile);
|
check_need_swap(newfile);
|
||||||
if (!read_stdin && (curbuf != old_curbuf
|
if (!read_stdin && (curbuf != old_curbuf
|
||||||
@@ -3407,9 +3403,7 @@ shorten_buf_fname(buf_T *buf, char_u *dirname, int force)
|
|||||||
char_u *p;
|
char_u *p;
|
||||||
|
|
||||||
if (buf->b_fname != NULL
|
if (buf->b_fname != NULL
|
||||||
#ifdef FEAT_QUICKFIX
|
|
||||||
&& !bt_nofilename(buf)
|
&& !bt_nofilename(buf)
|
||||||
#endif
|
|
||||||
&& !path_with_url(buf->b_fname)
|
&& !path_with_url(buf->b_fname)
|
||||||
&& (force
|
&& (force
|
||||||
|| buf->b_sfname == NULL
|
|| buf->b_sfname == NULL
|
||||||
|
|||||||
@@ -2152,10 +2152,7 @@ nb_do_cmd(
|
|||||||
if (p_write
|
if (p_write
|
||||||
&& !buf->bufp->b_p_ro
|
&& !buf->bufp->b_p_ro
|
||||||
&& buf->bufp->b_ffname != NULL
|
&& buf->bufp->b_ffname != NULL
|
||||||
#ifdef FEAT_QUICKFIX
|
&& !bt_dontwrite(buf->bufp))
|
||||||
&& !bt_dontwrite(buf->bufp)
|
|
||||||
#endif
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
bufref_T bufref;
|
bufref_T bufref;
|
||||||
|
|
||||||
|
|||||||
@@ -148,11 +148,8 @@ ses_do_win(win_T *wp)
|
|||||||
&& term_should_restore(wp->w_buffer);
|
&& term_should_restore(wp->w_buffer);
|
||||||
#endif
|
#endif
|
||||||
if (wp->w_buffer->b_fname == NULL
|
if (wp->w_buffer->b_fname == NULL
|
||||||
#ifdef FEAT_QUICKFIX
|
|
||||||
// When 'buftype' is "nofile" can't restore the window contents.
|
// When 'buftype' is "nofile" can't restore the window contents.
|
||||||
|| bt_nofilename(wp->w_buffer)
|
|| bt_nofilename(wp->w_buffer))
|
||||||
#endif
|
|
||||||
)
|
|
||||||
return (ssop_flags & SSOP_BLANK);
|
return (ssop_flags & SSOP_BLANK);
|
||||||
if (bt_help(wp->w_buffer))
|
if (bt_help(wp->w_buffer))
|
||||||
return (ssop_flags & SSOP_HELP);
|
return (ssop_flags & SSOP_HELP);
|
||||||
@@ -374,10 +371,7 @@ put_view(
|
|||||||
# endif
|
# endif
|
||||||
// Load the file.
|
// Load the file.
|
||||||
else if (wp->w_buffer->b_ffname != NULL
|
else if (wp->w_buffer->b_ffname != NULL
|
||||||
# ifdef FEAT_QUICKFIX
|
&& !bt_nofilename(wp->w_buffer))
|
||||||
&& !bt_nofilename(wp->w_buffer)
|
|
||||||
# endif
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
// Editing a file in this buffer: use ":edit file".
|
// Editing a file in this buffer: use ":edit file".
|
||||||
// This may have side effects! (e.g., compressed or network file).
|
// This may have side effects! (e.g., compressed or network file).
|
||||||
@@ -708,11 +702,9 @@ makeopens(
|
|||||||
{
|
{
|
||||||
if (!(only_save_windows && buf->b_nwindows == 0)
|
if (!(only_save_windows && buf->b_nwindows == 0)
|
||||||
&& !(buf->b_help && !(ssop_flags & SSOP_HELP))
|
&& !(buf->b_help && !(ssop_flags & SSOP_HELP))
|
||||||
#ifdef FEAT_TERMINAL
|
|
||||||
// Skip terminal buffers: finished ones are not useful, others
|
// Skip terminal buffers: finished ones are not useful, others
|
||||||
// will be resurrected and result in a new buffer.
|
// will be resurrected and result in a new buffer.
|
||||||
&& !bt_terminal(buf)
|
&& !bt_terminal(buf)
|
||||||
#endif
|
|
||||||
&& buf->b_fname != NULL
|
&& buf->b_fname != NULL
|
||||||
&& buf->b_p_bl)
|
&& buf->b_p_bl)
|
||||||
{
|
{
|
||||||
@@ -818,10 +810,7 @@ makeopens(
|
|||||||
if (ses_do_win(wp)
|
if (ses_do_win(wp)
|
||||||
&& wp->w_buffer->b_ffname != NULL
|
&& wp->w_buffer->b_ffname != NULL
|
||||||
&& !bt_help(wp->w_buffer)
|
&& !bt_help(wp->w_buffer)
|
||||||
#ifdef FEAT_QUICKFIX
|
&& !bt_nofilename(wp->w_buffer))
|
||||||
&& !bt_nofilename(wp->w_buffer)
|
|
||||||
#endif
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
if (need_tabnext && put_line(fd, "tabnext") == FAIL)
|
if (need_tabnext && put_line(fd, "tabnext") == FAIL)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|||||||
@@ -731,6 +731,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 */
|
||||||
|
/**/
|
||||||
|
263,
|
||||||
/**/
|
/**/
|
||||||
262,
|
262,
|
||||||
/**/
|
/**/
|
||||||
|
|||||||
@@ -434,12 +434,8 @@ write_viminfo_bufferlist(FILE *fp)
|
|||||||
{
|
{
|
||||||
if (buf->b_fname == NULL
|
if (buf->b_fname == NULL
|
||||||
|| !buf->b_p_bl
|
|| !buf->b_p_bl
|
||||||
#ifdef FEAT_QUICKFIX
|
|
||||||
|| bt_quickfix(buf)
|
|| bt_quickfix(buf)
|
||||||
#endif
|
|
||||||
#ifdef FEAT_TERMINAL
|
|
||||||
|| bt_terminal(buf)
|
|| bt_terminal(buf)
|
||||||
#endif
|
|
||||||
|| removable(buf->b_ffname))
|
|| removable(buf->b_ffname))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@@ -1994,11 +1990,7 @@ write_buffer_marks(buf_T *buf, FILE *fp_out)
|
|||||||
static int
|
static int
|
||||||
skip_for_viminfo(buf_T *buf)
|
skip_for_viminfo(buf_T *buf)
|
||||||
{
|
{
|
||||||
return
|
return bt_terminal(buf) || removable(buf->b_ffname);
|
||||||
#ifdef FEAT_TERMINAL
|
|
||||||
bt_terminal(buf) ||
|
|
||||||
#endif
|
|
||||||
removable(buf->b_ffname);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -172,12 +172,10 @@ do_window(
|
|||||||
case 's':
|
case 's':
|
||||||
CHECK_CMDWIN;
|
CHECK_CMDWIN;
|
||||||
reset_VIsual_and_resel(); // stop Visual mode
|
reset_VIsual_and_resel(); // stop Visual mode
|
||||||
#ifdef FEAT_QUICKFIX
|
|
||||||
// When splitting the quickfix window open a new buffer in it,
|
// When splitting the quickfix window open a new buffer in it,
|
||||||
// don't replicate the quickfix buffer.
|
// don't replicate the quickfix buffer.
|
||||||
if (bt_quickfix(curbuf))
|
if (bt_quickfix(curbuf))
|
||||||
goto newwindow;
|
goto newwindow;
|
||||||
#endif
|
|
||||||
#ifdef FEAT_GUI
|
#ifdef FEAT_GUI
|
||||||
need_mouse_correct = TRUE;
|
need_mouse_correct = TRUE;
|
||||||
#endif
|
#endif
|
||||||
@@ -189,12 +187,10 @@ do_window(
|
|||||||
case 'v':
|
case 'v':
|
||||||
CHECK_CMDWIN;
|
CHECK_CMDWIN;
|
||||||
reset_VIsual_and_resel(); // stop Visual mode
|
reset_VIsual_and_resel(); // stop Visual mode
|
||||||
#ifdef FEAT_QUICKFIX
|
|
||||||
// When splitting the quickfix window open a new buffer in it,
|
// When splitting the quickfix window open a new buffer in it,
|
||||||
// don't replicate the quickfix buffer.
|
// don't replicate the quickfix buffer.
|
||||||
if (bt_quickfix(curbuf))
|
if (bt_quickfix(curbuf))
|
||||||
goto newwindow;
|
goto newwindow;
|
||||||
#endif
|
|
||||||
#ifdef FEAT_GUI
|
#ifdef FEAT_GUI
|
||||||
need_mouse_correct = TRUE;
|
need_mouse_correct = TRUE;
|
||||||
#endif
|
#endif
|
||||||
@@ -228,9 +224,7 @@ do_window(
|
|||||||
case 'n':
|
case 'n':
|
||||||
CHECK_CMDWIN;
|
CHECK_CMDWIN;
|
||||||
reset_VIsual_and_resel(); // stop Visual mode
|
reset_VIsual_and_resel(); // stop Visual mode
|
||||||
#ifdef FEAT_QUICKFIX
|
|
||||||
newwindow:
|
newwindow:
|
||||||
#endif
|
|
||||||
if (Prenum)
|
if (Prenum)
|
||||||
// window height
|
// window height
|
||||||
vim_snprintf((char *)cbuf, sizeof(cbuf) - 5, "%ld", Prenum);
|
vim_snprintf((char *)cbuf, sizeof(cbuf) - 5, "%ld", Prenum);
|
||||||
|
|||||||
Reference in New Issue
Block a user