patch 8.2.0966: 'shortmess' flag "n" not used in two places
Problem: 'shortmess' flag "n" not used in two places.
Solution: Make use of the "n" flag consistent. (Nick Jensen, closes #6245,
closes #6244)
diff --git a/src/buffer.c b/src/buffer.c
index 66b0050..f928412 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -3651,7 +3651,7 @@
#ifdef FEAT_QUICKFIX
&& !bt_dontwrite(curbuf)
#endif
- ? _("[New file]") : "",
+ ? new_file_message() : "",
(curbuf->b_flags & BF_READERR) ? _("[Read errors]") : "",
curbuf->b_p_ro ? (shortmess(SHM_RO) ? _("[RO]")
: _("[readonly]")) : "",
diff --git a/src/bufwrite.c b/src/bufwrite.c
index f189551..4be48e2 100644
--- a/src/bufwrite.c
+++ b/src/bufwrite.c
@@ -598,6 +598,12 @@
}
#endif // UNIX
+ char *
+new_file_message(void)
+{
+ return shortmess(SHM_NEW) ? _("[New]") : _("[New File]");
+}
+
/*
* buf_write() - write to file "fname" lines "start" through "end"
*
@@ -2347,7 +2353,7 @@
}
else if (newfile)
{
- STRCAT(IObuff, shortmess(SHM_NEW) ? _("[New]") : _("[New File]"));
+ STRCAT(IObuff, new_file_message());
c = TRUE;
}
if (no_eol)
diff --git a/src/fileio.c b/src/fileio.c
index 06a4c51..3896ba8 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -506,7 +506,8 @@
}
}
if (dir_of_file_exists(fname))
- filemess(curbuf, sfname, (char_u *)_("[New File]"), 0);
+ filemess(curbuf, sfname,
+ (char_u *)new_file_message(), 0);
else
filemess(curbuf, sfname,
(char_u *)_("[New DIRECTORY]"), 0);
diff --git a/src/proto/bufwrite.pro b/src/proto/bufwrite.pro
index 5d7b4a2..72c08da 100644
--- a/src/proto/bufwrite.pro
+++ b/src/proto/bufwrite.pro
@@ -1,3 +1,4 @@
/* bufwrite.c */
+char *new_file_message(void);
int buf_write(buf_T *buf, char_u *fname, char_u *sfname, linenr_T start, linenr_T end, exarg_T *eap, int append, int forceit, int reset_changed, int filtering);
/* vim: set ft=c : */
diff --git a/src/testdir/dumps/Test_popup_textprop_corn_5.dump b/src/testdir/dumps/Test_popup_textprop_corn_5.dump
index c79e898..59bae78 100644
--- a/src/testdir/dumps/Test_popup_textprop_corn_5.dump
+++ b/src/testdir/dumps/Test_popup_textprop_corn_5.dump
@@ -9,4 +9,4 @@
|~+0#4040ff13&| @35||+1#0000000&|5+0&&|3| @21|╚+0#0000001#ffd7ff255|═@9|╝| +0#0000000#ffffff0
|~+0#4040ff13&| @35||+1#0000000&|5+0&&|4| @34
|f+3&&|o@1| @15|0|,|0|-|1| @9|A|l@1| |[+1&&|N|o| |N|a|m|e|]| |[|+|]| @5|4|6|,|1| @10|4|8|%
-|"+0&&|f|o@1|"| |[|N|e|w| |F|i|l|e|]| @58
+|"+0&&|f|o@1|"| |[|N|e|w|]| @63
diff --git a/src/testdir/dumps/Test_start_with_tabs.dump b/src/testdir/dumps/Test_start_with_tabs.dump
index 5490805..0659466 100644
--- a/src/testdir/dumps/Test_start_with_tabs.dump
+++ b/src/testdir/dumps/Test_start_with_tabs.dump
@@ -17,4 +17,4 @@
|~| @73
|~| @73
|~| @73
-|"+0#0000000&|a|"| |[|N|e|w| |F|i|l|e|]| @42|0|,|0|-|1| @8|A|l@1|
+|"+0#0000000&|a|"| |[|N|e|w|]| @47|0|,|0|-|1| @8|A|l@1|
diff --git a/src/version.c b/src/version.c
index bc4cc43..fc2269c 100644
--- a/src/version.c
+++ b/src/version.c
@@ -755,6 +755,8 @@
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 966,
+/**/
965,
/**/
964,