forked from aniani/vim
patch 9.0.0509: confusing error for "saveas" command with "nofile" buffer
Problem: Confusing error for "saveas" command with "nofile" buffer. Solution: Give a clearer error message. (closes #11171)
This commit is contained in:
@@ -888,7 +888,8 @@ buf_write(
|
|||||||
--no_wait_return;
|
--no_wait_return;
|
||||||
msg_scroll = msg_save;
|
msg_scroll = msg_save;
|
||||||
if (nofile_err)
|
if (nofile_err)
|
||||||
emsg(_(e_no_matching_autocommands_for_acwrite_buffer));
|
semsg(_(e_no_matching_autocommands_for_buftype_str_buffer),
|
||||||
|
curbuf->b_p_bt);
|
||||||
|
|
||||||
if (nofile_err
|
if (nofile_err
|
||||||
#ifdef FEAT_EVAL
|
#ifdef FEAT_EVAL
|
||||||
|
@@ -1715,8 +1715,8 @@ EXTERN char e_printmbcharset_cannot_be_empty_with_multi_byte_encoding[]
|
|||||||
EXTERN char e_no_default_font_specified_for_multi_byte_printing[]
|
EXTERN char e_no_default_font_specified_for_multi_byte_printing[]
|
||||||
INIT(= N_("E675: No default font specified for multi-byte printing."));
|
INIT(= N_("E675: No default font specified for multi-byte printing."));
|
||||||
#endif
|
#endif
|
||||||
EXTERN char e_no_matching_autocommands_for_acwrite_buffer[]
|
EXTERN char e_no_matching_autocommands_for_buftype_str_buffer[]
|
||||||
INIT(= N_("E676: No matching autocommands for acwrite buffer"));
|
INIT(= N_("E676: No matching autocommands for buftype=%s buffer"));
|
||||||
#ifdef FEAT_SYN_HL
|
#ifdef FEAT_SYN_HL
|
||||||
EXTERN char e_error_writing_temp_file[]
|
EXTERN char e_error_writing_temp_file[]
|
||||||
INIT(= N_("E677: Error writing temp file"));
|
INIT(= N_("E677: Error writing temp file"));
|
||||||
|
@@ -238,6 +238,12 @@ func Test_saveas()
|
|||||||
syntax off
|
syntax off
|
||||||
%bw!
|
%bw!
|
||||||
call delete('Xsaveas.pl')
|
call delete('Xsaveas.pl')
|
||||||
|
|
||||||
|
" :saveas fails for "nofile" buffer
|
||||||
|
set buftype=nofile
|
||||||
|
call assert_fails('saveas Xsafile', 'E676: No matching autocommands for buftype=nofile buffer')
|
||||||
|
|
||||||
|
bwipe!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_write_errors()
|
func Test_write_errors()
|
||||||
|
@@ -699,6 +699,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 */
|
||||||
|
/**/
|
||||||
|
509,
|
||||||
/**/
|
/**/
|
||||||
508,
|
508,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user