commit
fdbb5a8f72
|
@ -4707,6 +4707,7 @@ getwininfo([{winid}]) *getwininfo()*
|
|||
height window height (excluding winbar)
|
||||
loclist 1 if showing a location list
|
||||
quickfix 1 if quickfix or location list window
|
||||
terminal 1 if a terminal window
|
||||
tabnr tab page number
|
||||
topline first displayed buffer line
|
||||
variables a reference to the dictionary with
|
||||
|
|
|
@ -1425,7 +1425,7 @@ do_buffer(
|
|||
}
|
||||
}
|
||||
if (bufIsChanged(curbuf)) {
|
||||
EMSG(_(e_nowrtmsg));
|
||||
no_write_message();
|
||||
return FAIL;
|
||||
}
|
||||
}
|
||||
|
@ -1626,6 +1626,16 @@ void do_autochdir(void)
|
|||
}
|
||||
}
|
||||
|
||||
void no_write_message(void)
|
||||
{
|
||||
EMSG(_("E37: No write since last change (add ! to override)"));
|
||||
}
|
||||
|
||||
void no_write_message_nobang(void)
|
||||
{
|
||||
EMSG(_("E37: No write since last change"));
|
||||
}
|
||||
|
||||
//
|
||||
// functions for dealing with the buffer list
|
||||
//
|
||||
|
|
|
@ -10615,6 +10615,7 @@ static dict_T *get_win_info(win_T *wp, int16_t tpnr, int16_t winnr)
|
|||
tv_dict_add_nr(dict, S_LEN("bufnr"), wp->w_buffer->b_fnum);
|
||||
tv_dict_add_nr(dict, S_LEN("wincol"), wp->w_wincol);
|
||||
|
||||
tv_dict_add_nr(dict, S_LEN("terminal"), bt_terminal(wp->w_buffer));
|
||||
tv_dict_add_nr(dict, S_LEN("quickfix"), bt_quickfix(wp->w_buffer));
|
||||
tv_dict_add_nr(dict, S_LEN("loclist"),
|
||||
(bt_quickfix(wp->w_buffer) && wp->w_llist_ref != NULL));
|
||||
|
|
|
@ -2076,7 +2076,7 @@ int getfile(int fnum, char_u *ffname, char_u *sfname, int setpm, linenr_T lnum,
|
|||
}
|
||||
if (curbufIsChanged()) {
|
||||
no_wait_return--;
|
||||
EMSG(_(e_nowrtmsg));
|
||||
no_write_message();
|
||||
retval = GETFILE_NOT_WRITTEN; // File has been changed.
|
||||
goto theend;
|
||||
}
|
||||
|
|
|
@ -1274,9 +1274,9 @@ bool check_changed(buf_T *buf, int flags)
|
|||
return bufIsChanged(buf);
|
||||
}
|
||||
if (flags & CCGD_EXCMD) {
|
||||
EMSG(_(e_nowrtmsg));
|
||||
no_write_message();
|
||||
} else {
|
||||
EMSG(_(e_nowrtmsg_nobang));
|
||||
no_write_message_nobang();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -6216,7 +6216,7 @@ ex_win_close(
|
|||
}
|
||||
need_hide = false;
|
||||
} else {
|
||||
EMSG(_(e_nowrtmsg));
|
||||
no_write_message();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -985,9 +985,6 @@ EXTERN char_u e_notmp[] INIT(= N_("E483: Can't get temp file name"));
|
|||
EXTERN char_u e_notopen[] INIT(= N_("E484: Can't open file %s"));
|
||||
EXTERN char_u e_notopen_2[] INIT(= N_("E484: Can't open file %s: %s"));
|
||||
EXTERN char_u e_notread[] INIT(= N_("E485: Can't read file %s"));
|
||||
EXTERN char_u e_nowrtmsg[] INIT(= N_(
|
||||
"E37: No write since last change (add ! to override)"));
|
||||
EXTERN char_u e_nowrtmsg_nobang[] INIT(= N_("E37: No write since last change"));
|
||||
EXTERN char_u e_null[] INIT(= N_("E38: Null argument"));
|
||||
EXTERN char_u e_number_exp[] INIT(= N_("E39: Number expected"));
|
||||
EXTERN char_u e_openerrf[] INIT(= N_("E40: Can't open errorfile %s"));
|
||||
|
|
|
@ -2204,7 +2204,7 @@ static int qf_jump_edit_buffer(qf_info_T *qi, qfline_T *qf_ptr, int forceit,
|
|||
// Open help file (do_ecmd() will set b_help flag, readfile() will
|
||||
// set b_p_ro flag).
|
||||
if (!can_abandon(curbuf, forceit)) {
|
||||
EMSG(_(e_nowrtmsg));
|
||||
no_write_message();
|
||||
retval = false;
|
||||
} else {
|
||||
retval = do_ecmd(qf_ptr->qf_fnum, NULL, NULL, NULL, (linenr_T)1,
|
||||
|
|
|
@ -246,3 +246,7 @@ func! Screenline(lnum)
|
|||
let line = join(chars, '')
|
||||
return matchstr(line, '^.\{-}\ze\s*$')
|
||||
endfunc
|
||||
|
||||
func CanRunGui()
|
||||
return has('gui') && ($DISPLAY != "" || has('gui_running'))
|
||||
endfunc
|
||||
|
|
|
@ -86,8 +86,11 @@ func Test_statusline()
|
|||
call assert_match('^Xstatusline\s*$', s:get_statusline())
|
||||
|
||||
" %F: Full path to the file in the buffer.
|
||||
let shellslash = &shellslash
|
||||
set shellslash
|
||||
set statusline=%F
|
||||
call assert_match('/testdir/Xstatusline\s*$', s:get_statusline())
|
||||
let &shellslash = shellslash
|
||||
|
||||
" %h: Help buffer flag, text is "[help]".
|
||||
" %H: Help buffer flag, text is ",HLP".
|
||||
|
|
Loading…
Reference in New Issue