Commit 4d996e4c authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

screen: suppress line numbers when the terminal is very narrow

To prevent the display from getting messed up, making nano unusable.
No related merge requests found
Showing with 5 additions and 3 deletions
+5 -3
...@@ -2269,10 +2269,12 @@ void edit_draw(filestruct *fileptr, const char *converted, int ...@@ -2269,10 +2269,12 @@ void edit_draw(filestruct *fileptr, const char *converted, int
assert(strlenpt(converted) <= editwincols); assert(strlenpt(converted) <= editwincols);
#ifdef ENABLE_LINENUMBERS #ifdef ENABLE_LINENUMBERS
if (ISSET(LINE_NUMBERS)) { int needed_margin = digits(openfile->filebot->lineno) + 1;
if (ISSET(LINE_NUMBERS) && needed_margin < COLS - 3) {
/* If the line numbers now require more room, schedule a refresh. */ /* If the line numbers now require more room, schedule a refresh. */
if (digits(openfile->filebot->lineno) + 1 != margin) { if (needed_margin != margin) {
margin = digits(openfile->filebot->lineno) + 1; margin = needed_margin;
editwincols = COLS - margin; editwincols = COLS - margin;
refresh_needed = TRUE; refresh_needed = TRUE;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment