[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 1/7] tweaks: move the displaying of the state letters into a sepa
From: |
Benno Schulenberg |
Subject: |
[PATCH 1/7] tweaks: move the displaying of the state letters into a separate function |
Date: |
Tue, 15 Dec 2020 10:44:03 +0100 |
---
src/winio.c | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/src/winio.c b/src/winio.c
index e961cccb..05a6f858 100644
--- a/src/winio.c
+++ b/src/winio.c
@@ -1867,6 +1867,19 @@ int buffer_number(openfilestruct *buffer)
}
#endif
+#ifndef NANO_TINY
+/* Show the state of auto-indenting, the mark, hard-wrapping, macro recording,
+ * and soft-wrapping by showing corresponding letters in the given window. */
+void show_states_at(WINDOW *window)
+{
+ waddstr(window, ISSET(AUTOINDENT) ? "I" : " ");
+ waddstr(window, openfile->mark ? "M" : " ");
+ waddstr(window, ISSET(BREAK_LONG_LINES) ? "L" : " ");
+ waddstr(window, recording ? "R" : " ");
+ waddstr(window, ISSET(SOFTWRAP) ? "S" : " ");
+}
+#endif
+
/* If path is NULL, we're in normal editing mode, so display the current
* version of nano, the current filename, and whether the current file
* has been modified on the title bar. If path isn't NULL, we're either
@@ -2009,11 +2022,7 @@ void titlebar(const char *path)
waddstr(topwin, " *");
if (statelen < COLS) {
wmove(topwin, 0, COLS + 2 - statelen);
- waddstr(topwin, ISSET(AUTOINDENT) ? "I" : " ");
- waddstr(topwin, openfile->mark ? "M" : " ");
- waddstr(topwin, ISSET(BREAK_LONG_LINES) ? "L" : " ");
- waddstr(topwin, recording ? "R" : " ");
- waddstr(topwin, ISSET(SOFTWRAP) ? "S" : " ");
+ show_states_at(topwin);
}
} else
#endif
--
2.29.2
- [PATCH 1/7] tweaks: move the displaying of the state letters into a separate function,
Benno Schulenberg <=
- [PATCH 2/7] display: add code for showing minimal state-information bar at the bottom, Benno Schulenberg, 2020/12/15
- [PATCH 3/7] options: add --minibar and -_ for activating basic state-information bar, Benno Schulenberg, 2020/12/15
- [PATCH 4/7] minibar: show the info bar again some 0.8 seconds after a message, Benno Schulenberg, 2020/12/15
- [PATCH 5/7] feedback: differentiate between remarks, mistakes, and information, Benno Schulenberg, 2020/12/15
- [PATCH 6/7] minibar: add an [x/y] "counter" when multiple files are open, Benno Schulenberg, 2020/12/15
- [PATCH 7/7] minibar: show the line count in the bar (at startup and when switching), Benno Schulenberg, 2020/12/15