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
3e22240f
Commit
3e22240f
authored
8 years ago
by
David Lawrence Ramsey
Committed by
Benno Schulenberg
8 years ago
Browse files
Options
Download
Email Patches
Plain Diff
tweaks: rename mouse_x & mouse_y to mouse_col & mouse_row in do_mouse()
parent
34e086f0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/nano.c
+13
-13
src/nano.c
with
13 additions
and
13 deletions
+13
-13
src/nano.c
View file @
3e22240f
...
...
@@ -1724,24 +1724,24 @@ void xoff_complaint(void)
/* Handle a mouse click on the edit window or the shortcut list. */
int
do_mouse
(
void
)
{
int
mouse_
x
,
mouse_
y
;
int
retval
=
get_mouseinput
(
&
mouse_
x
,
&
mouse_
y
,
TRUE
);
int
mouse_
col
,
mouse_
row
;
int
retval
=
get_mouseinput
(
&
mouse_
col
,
&
mouse_
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_
y
,
&
mouse_
x
,
FALSE
))
{
bool
sameline
=
(
mouse_
y
==
openfile
->
current_y
);
/* Whether the click was on the
line
where the cursor is. */
if
(
wmouse_trafo
(
edit
,
&
mouse_
row
,
&
mouse_
col
,
FALSE
))
{
bool
sameline
=
(
mouse_
row
==
openfile
->
current_y
);
/* Whether the click was on the
row
where the cursor is. */
filestruct
*
current_save
=
openfile
->
current
;
#ifndef NANO_TINY
size_t
current_x_save
=
openfile
->
current_x
;
#endif
#ifdef DEBUG
fprintf
(
stderr
,
"mouse_
y
= %d, current_y = %ld
\n
"
,
mouse_
y
,
(
long
)
openfile
->
current_y
);
fprintf
(
stderr
,
"mouse_
row
= %d, current_y = %ld
\n
"
,
mouse_
row
,
(
long
)
openfile
->
current_y
);
#endif
#ifndef NANO_TINY
...
...
@@ -1750,18 +1750,18 @@ int do_mouse(void)
openfile
->
current
=
openfile
->
edittop
;
while
(
openfile
->
current
->
next
!=
NULL
&&
current_row
<
mouse_
y
)
{
while
(
openfile
->
current
->
next
!=
NULL
&&
current_row
<
mouse_
row
)
{
current_row
+=
strlenpt
(
openfile
->
current
->
data
)
/
editwincols
+
1
;
openfile
->
current
=
openfile
->
current
->
next
;
}
if
(
current_row
>
mouse_
y
)
{
if
(
current_row
>
mouse_
row
)
{
openfile
->
current
=
openfile
->
current
->
prev
;
current_row
-=
strlenpt
(
openfile
->
current
->
data
)
/
editwincols
+
1
;
openfile
->
current_x
=
actual_x
(
openfile
->
current
->
data
,
((
mouse_
y
-
current_row
)
*
editwincols
)
+
mouse_
x
);
((
mouse_
row
-
current_row
)
*
editwincols
)
+
mouse_
col
);
}
else
openfile
->
current_x
=
actual_x
(
openfile
->
current
->
data
,
mouse_
x
);
openfile
->
current_x
=
actual_x
(
openfile
->
current
->
data
,
mouse_
col
);
openfile
->
current_y
=
current_row
;
ensure_line_is_visible
();
...
...
@@ -1772,17 +1772,17 @@ int do_mouse(void)
ssize_t
current_row
=
openfile
->
current_y
;
/* Move to where the click occurred. */
while
(
current_row
<
mouse_
y
&&
openfile
->
current
->
next
!=
NULL
)
{
while
(
current_row
<
mouse_
row
&&
openfile
->
current
->
next
!=
NULL
)
{
openfile
->
current
=
openfile
->
current
->
next
;
current_row
++
;
}
while
(
current_row
>
mouse_
y
&&
openfile
->
current
->
prev
!=
NULL
)
{
while
(
current_row
>
mouse_
row
&&
openfile
->
current
->
prev
!=
NULL
)
{
openfile
->
current
=
openfile
->
current
->
prev
;
current_row
--
;
}
openfile
->
current_x
=
actual_x
(
openfile
->
current
->
data
,
get_page_start
(
xplustabs
())
+
mouse_
x
);
get_page_start
(
xplustabs
())
+
mouse_
col
);
}
#ifndef NANO_TINY
...
...
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