tweaks: move the displaying of the state letters into a separate function
Этот коммит содержится в:
родитель
8939163659
Коммит
f52f503c38
19
src/winio.c
19
src/winio.c
@ -1868,6 +1868,19 @@ int buffer_number(openfilestruct *buffer)
|
|||||||
}
|
}
|
||||||
#endif
|
#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
|
/* 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
|
* 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
|
* 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, " *");
|
waddstr(topwin, " *");
|
||||||
if (statelen < COLS) {
|
if (statelen < COLS) {
|
||||||
wmove(topwin, 0, COLS + 2 - statelen);
|
wmove(topwin, 0, COLS + 2 - statelen);
|
||||||
waddstr(topwin, ISSET(AUTOINDENT) ? "I" : " ");
|
show_states_at(topwin);
|
||||||
waddstr(topwin, openfile->mark ? "M" : " ");
|
|
||||||
waddstr(topwin, ISSET(BREAK_LONG_LINES) ? "L" : " ");
|
|
||||||
waddstr(topwin, recording ? "R" : " ");
|
|
||||||
waddstr(topwin, ISSET(SOFTWRAP) ? "S" : " ");
|
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user