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
0e9fb6a0
Commit
0e9fb6a0
authored
6 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
tweaks: rename two variables, to be more descriptive
parent
34b8d588
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
+10
-11
src/winio.c
with
10 additions
and
11 deletions
+10
-11
src/winio.c
View file @
0e9fb6a0
...
@@ -1672,10 +1672,10 @@ int get_mouseinput(int *mouse_y, int *mouse_x, bool allow_shortcuts)
...
@@ -1672,10 +1672,10 @@ int get_mouseinput(int *mouse_y, int *mouse_x, bool allow_shortcuts)
* to figure out which shortcut was released on/clicked and put
* to figure out which shortcut was released on/clicked and put
* back the equivalent keystroke(s) for it. */
* back the equivalent keystroke(s) for it. */
if
(
allow_shortcuts
&&
!
ISSET
(
NO_HELP
)
&&
in_bottomwin
)
{
if
(
allow_shortcuts
&&
!
ISSET
(
NO_HELP
)
&&
in_bottomwin
)
{
int
i
;
int
width
;
/* The width of all the shortcuts, except for the last
/* The width of all the shortcuts, except for the last
* two, in the shortcut list in bottomwin. */
* two, in the shortcut list in bottomwin. */
int
j
;
int
index
;
/* The calculated index number of the clicked item. */
/* The calculated index number of the clicked item. */
size_t
number
;
size_t
number
;
/* The number of available shortcuts in the current menu. */
/* The number of available shortcuts in the current menu. */
...
@@ -1702,23 +1702,23 @@ int get_mouseinput(int *mouse_y, int *mouse_x, bool allow_shortcuts)
...
@@ -1702,23 +1702,23 @@ int get_mouseinput(int *mouse_y, int *mouse_x, bool allow_shortcuts)
number
=
MAIN_VISIBLE
;
number
=
MAIN_VISIBLE
;
/* Calculate the width of all of the shortcuts in the list
/* Calculate the width of all of the shortcuts in the list
* except for the last two, which are longer by (COLS %
i
)
* except for the last two, which are longer by (COLS %
width
)
* columns so as to not waste space. */
* columns so as to not waste space. */
if
(
number
<
2
)
if
(
number
<
2
)
i
=
COLS
/
(
MAIN_VISIBLE
/
2
);
width
=
COLS
/
(
MAIN_VISIBLE
/
2
);
else
else
i
=
COLS
/
((
number
/
2
)
+
(
number
%
2
));
width
=
COLS
/
((
number
/
2
)
+
(
number
%
2
));
/* Calculate the one-based index in the shortcut list. */
/* Calculate the one-based index in the shortcut list. */
j
=
(
*
mouse_x
/
i
)
*
2
+
*
mouse_y
;
index
=
(
*
mouse_x
/
width
)
*
2
+
*
mouse_y
;
/* Adjust the index if we hit the last two wider ones. */
/* Adjust the index if we hit the last two wider ones. */
if
((
j
>
number
)
&&
(
*
mouse_x
%
i
<
COLS
%
i
))
if
((
index
>
number
)
&&
(
*
mouse_x
%
width
<
COLS
%
width
))
j
-=
2
;
index
-=
2
;
/* Ignore releases/clicks of the first mouse button beyond
/* Ignore releases/clicks of the first mouse button beyond
* the last shortcut. */
* the last shortcut. */
if
(
j
>
number
)
if
(
index
>
number
)
return
2
;
return
2
;
/* Go through the list of functions to determine which
/* Go through the list of functions to determine which
...
@@ -1729,8 +1729,7 @@ int get_mouseinput(int *mouse_y, int *mouse_x, bool allow_shortcuts)
...
@@ -1729,8 +1729,7 @@ int get_mouseinput(int *mouse_y, int *mouse_x, bool allow_shortcuts)
if
(
first_sc_for
(
currmenu
,
f
->
func
)
==
NULL
)
if
(
first_sc_for
(
currmenu
,
f
->
func
)
==
NULL
)
continue
;
continue
;
/* Tick off an actually shown shortcut. */
/* Tick off an actually shown shortcut. */
j
-=
1
;
if
(
--
index
==
0
)
if
(
j
==
0
)
break
;
break
;
}
}
...
...
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