Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
cs24-19fa
git_rec_nano
Commits
0dd2a552
Commit
0dd2a552
authored
8 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
screen: don't die when the window is narrower than four columns
This fixes
https://savannah.gnu.org/bugs/?48520
.
parent
49fc528d
master
feature/match-parens
refactor/readbility
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/nano.c
+4
-2
src/nano.c
src/nano.h
+0
-5
src/nano.h
src/winio.c
+5
-4
src/winio.c
with
9 additions
and
11 deletions
+9
-11
src/nano.c
View file @
0dd2a552
...
...
@@ -692,9 +692,11 @@ void die_save_file(const char *die_filename, struct stat *die_stat)
/* Initialize the three window portions nano uses. */
void
window_init
(
void
)
{
/*
If the screen height is too small, get out
. */
/*
Compute how many lines the edit subwindow will have
. */
editwinrows
=
LINES
-
TOP_ROWS
-
BOTTOM_ROWS
;
if
(
COLS
<
MIN_EDITOR_COLS
||
editwinrows
<
MIN_EDITOR_ROWS
)
/* If there is no room to show anything, give up. */
if
(
editwinrows
<=
0
)
die
(
_
(
"Window size is too small for nano...
\n
"
));
#ifndef DISABLE_WRAPJUSTIFY
...
...
This diff is collapsed.
Click to expand it.
src/nano.h
View file @
0dd2a552
...
...
@@ -576,11 +576,6 @@ enum
/* The maximum number of entries displayed in the main shortcut list. */
#define MAIN_VISIBLE (((COLS + 40) / 20) * 2)
/* The minimum editor window columns and rows required for nano to work
* correctly. Don't make these smaller than 4 and 1. */
#define MIN_EDITOR_COLS 4
#define MIN_EDITOR_ROWS 1
/* The default number of characters from the end of the line where
* wrapping occurs. */
#define CHARS_FROM_EOL 8
...
...
This diff is collapsed.
Click to expand it.
src/winio.c
View file @
0dd2a552
...
...
@@ -2048,12 +2048,13 @@ void bottombars(int menu)
slen
=
MAIN_VISIBLE
;
}
/* There will be this many characters per column, except for the
* last two, which will be longer by (COLS % colwidth) columns so as
* to not waste space. We need at least three columns to display
* anything properly. */
/* Compute the width of each keyname-plus-explanation pair. */
colwidth
=
COLS
/
((
slen
/
2
)
+
(
slen
%
2
));
/* If there is no room, don't print anything. */
if
(
colwidth
==
0
)
return
;
blank_bottombars
();
#ifdef DEBUG
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help