nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit f52f503c388817e9a336ef9d6debe15dfe4f8b6f
parent 89391636599e7d48a74b1d27b26257a79c665282
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Thu, 15 Oct 2020 19:54:05 +0200

tweaks: move the displaying of the state letters into a separate function

Diffstat:
Msrc/winio.c | 19++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/src/winio.c b/src/winio.c @@ -1868,6 +1868,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 @@ -2010,11 +2023,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