commit 7f3fdb47909893e0c8a51ed43f7b1768e8dd5604
parent d59c42363bdaccb471543ec953736d6bad91badb
Author: David Lawrence Ramsey <pooka109@gmail.com>
Date: Sat, 8 Jul 2006 23:45:15 +0000
in titlebar(), don't display any blank space for the state if we're in
the file browser, as Pico doesn't, and since path is always assumed to
be NULL if DISABLE_BROWSER is defined, put the check for its being NULL
in a DISABLE_BROWSER #define
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3769 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
Diffstat:
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
@@ -89,6 +89,11 @@ CVS code -
titlebar()
- Don't display overly long filenames with ellipses if the
number of columns is extremely small. (DLR)
+ - Don't display any blank space for the state if we're in the
+ file browser, as Pico doesn't. (DLR)
+ - Since path is always assumed to be NULL if DISABLE_BROWSER is
+ defined, put the check for its being NULL in a DISABLE_BROWSER
+ #define. (DLR)
- doc/syntax/c.nanorc:
- Since .i and .ii are preprocessed C and C++ output, colorize
them here. (Mike Frysinger)
diff --git a/src/winio.c b/src/winio.c
@@ -1964,7 +1964,7 @@ void titlebar(const char *path)
* buffer. */
size_t statelen = 0;
/* The length of the state in columns, or the length of
- * "Modified" if the state is blank. */
+ * "Modified" if the state is blank and path is NULL. */
char *exppath = NULL;
/* The filename, expanded for display. */
bool newfie = FALSE;
@@ -2010,7 +2010,11 @@ void titlebar(const char *path)
state = openfile->modified ? _("Modified") : ISSET(VIEW_MODE) ?
_("View") : "";
- statelen = strlenpt((state[0] != '\0') ? state : _("Modified"));
+ statelen = strlenpt((state[0] == '\0'
+#ifndef DISABLE_BROWSER
+ && path == NULL
+#endif
+ ) ? _("Modified") : state);
/* If possible, add a space before state. */
if (space > 0 && statelen < space)
@@ -2038,7 +2042,9 @@ void titlebar(const char *path)
/* If we're not in the file browser, path should be the current
* filename. */
+#ifndef DISABLE_BROWSER
if (path == NULL)
+#endif
path = openfile->filename;
/* Account for the full lengths of the prefix and the state. */