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
c19f0c73
Commit
c19f0c73
authored
8 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
tweaks: simplify the determination of the number of shown help items
parent
6ad3700a
master
feature/match-parens
refactor/readbility
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/winio.c
+8
-20
src/winio.c
with
8 additions
and
20 deletions
+8
-20
src/winio.c
View file @
c19f0c73
...
...
@@ -1476,17 +1476,11 @@ int get_mouseinput(int *mouse_x, int *mouse_y, bool allow_shortcuts)
return
0
;
}
/* Get the shortcut lists' length. */
if
(
currmenu
==
MMAIN
)
currslen
=
MAIN_VISIBLE
;
else
{
currslen
=
length_of_list
(
currmenu
);
/* Determine how many shortcuts are being shown. */
currslen
=
length_of_list
(
currmenu
);
/* We don't show any more shortcuts than the main list
* does. */
if
(
currslen
>
MAIN_VISIBLE
)
currslen
=
MAIN_VISIBLE
;
}
if
(
currslen
>
MAIN_VISIBLE
)
currslen
=
MAIN_VISIBLE
;
/* Calculate the width of all of the shortcuts in the list
* except for the last two, which are longer by (COLS % i)
...
...
@@ -2047,17 +2041,11 @@ void bottombars(int menu)
if
(
ISSET
(
NO_HELP
)
||
LINES
<
5
)
return
;
if
(
menu
==
MMAIN
)
{
slen
=
MAIN_VISIBLE
;
assert
(
slen
<=
length_of_list
(
menu
));
}
else
{
slen
=
length_of_list
(
menu
);
/* Determine how many shortcuts there are to show. */
slen
=
length_of_list
(
menu
);
/* Don't show any more shortcuts than the main list does. */
if
(
slen
>
MAIN_VISIBLE
)
slen
=
MAIN_VISIBLE
;
}
if
(
slen
>
MAIN_VISIBLE
)
slen
=
MAIN_VISIBLE
;
/* Compute the width of each keyname-plus-explanation pair. */
colwidth
=
COLS
/
((
slen
/
2
)
+
(
slen
%
2
));
...
...
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