Skip to content
GitLab
Menu
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
90ebff00
Commit
90ebff00
authored
7 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
tweaks: rename two variables, and swap their declaration order
parent
cdc9a295
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/nano.c
+7
-7
src/nano.c
src/prompt.c
+5
-5
src/prompt.c
with
12 additions
and
12 deletions
+12
-12
src/nano.c
View file @
90ebff00
...
...
@@ -1564,21 +1564,21 @@ void unbound_key(int code)
/* Handle a mouse click on the edit window or the shortcut list. */
int
do_mouse
(
void
)
{
int
mouse_col
,
mouse_row
;
int
retval
=
get_mouseinput
(
&
mouse
_col
,
&
mouse
_row
,
TRUE
);
int
click_row
,
click_col
;
int
retval
=
get_mouseinput
(
&
click
_col
,
&
click
_row
,
TRUE
);
/* If the click is wrong or already handled, we're done. */
if
(
retval
!=
0
)
return
retval
;
/* If the click was in the edit window, put the cursor in that spot. */
if
(
wmouse_trafo
(
edit
,
&
mouse
_row
,
&
mouse
_col
,
FALSE
))
{
if
(
wmouse_trafo
(
edit
,
&
click
_row
,
&
click
_col
,
FALSE
))
{
filestruct
*
current_save
=
openfile
->
current
;
ssize_t
row_count
=
mouse
_row
-
openfile
->
current_y
;
ssize_t
row_count
=
click
_row
-
openfile
->
current_y
;
size_t
leftedge
;
#ifndef NANO_TINY
size_t
current_x_save
=
openfile
->
current_x
;
bool
sameline
=
(
mouse
_row
==
openfile
->
current_y
);
bool
sameline
=
(
click
_row
==
openfile
->
current_y
);
/* Whether the click was on the row where the cursor is. */
if
(
ISSET
(
SOFTWRAP
))
...
...
@@ -1587,14 +1587,14 @@ int do_mouse(void)
#endif
leftedge
=
get_page_start
(
xplustabs
());
/* Move current up or down to the row
corresponding to mouse_row
. */
/* Move current up or down to the row
that was clicked on
. */
if
(
row_count
<
0
)
go_back_chunks
(
-
row_count
,
&
openfile
->
current
,
&
leftedge
);
else
go_forward_chunks
(
row_count
,
&
openfile
->
current
,
&
leftedge
);
openfile
->
current_x
=
actual_x
(
openfile
->
current
->
data
,
actual_last_column
(
leftedge
,
mouse
_col
));
actual_last_column
(
leftedge
,
click
_col
));
#ifndef NANO_TINY
/* Clicking where the cursor is toggles the mark, as does clicking
...
...
This diff is collapsed.
Click to expand it.
src/prompt.c
View file @
90ebff00
...
...
@@ -32,18 +32,18 @@ static size_t statusbar_x = HIGHEST_POSITIVE;
/* Handle a mouse click on the statusbar prompt or the shortcut list. */
int
do_statusbar_mouse
(
void
)
{
int
mouse_x
,
mouse_y
;
int
retval
=
get_mouseinput
(
&
mouse_x
,
&
mouse_y
,
TRUE
);
int
click_row
,
click_col
;
int
retval
=
get_mouseinput
(
&
click_col
,
&
click_row
,
TRUE
);
/* We can click on the statusbar window text to move the cursor. */
if
(
retval
==
0
&&
wmouse_trafo
(
bottomwin
,
&
mouse_y
,
&
mouse_x
,
FALSE
))
{
if
(
retval
==
0
&&
wmouse_trafo
(
bottomwin
,
&
click_row
,
&
click_col
,
FALSE
))
{
size_t
start_col
=
strlenpt
(
prompt
)
+
2
;
/* Move to where the click occurred. */
if
(
mouse_x
>=
start_col
&&
mouse_y
==
0
)
{
if
(
click_row
==
0
&&
click_col
>=
start_col
)
{
statusbar_x
=
actual_x
(
answer
,
get_statusbar_page_start
(
start_col
,
start_col
+
statusbar_xplustabs
())
+
mouse_x
-
start_col
);
statusbar_xplustabs
())
+
click_col
-
start_col
);
update_the_statusbar
();
}
}
...
...
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