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
b7f11363
Commit
b7f11363
authored
8 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
tweaks: trim or improve some comments, and rewrap two lines
parent
2503503a
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/browser.c
+9
-12
src/browser.c
with
9 additions
and
12 deletions
+9
-12
src/browser.c
View file @
b7f11363
...
...
@@ -141,27 +141,25 @@ char *do_browser(char *path, DIR *dir)
if
(
kbinput
==
KEY_MOUSE
)
{
int
mouse_x
,
mouse_y
;
/* We can click on the edit window to select a
* filename. */
/* We can click on the edit window to select a filename. */
if
(
get_mouseinput
(
&
mouse_x
,
&
mouse_y
,
TRUE
)
==
0
&&
wmouse_trafo
(
edit
,
&
mouse_y
,
&
mouse_x
,
FALSE
))
{
wmouse_trafo
(
edit
,
&
mouse_y
,
&
mouse_x
,
FALSE
))
{
/* longest is the width of each column. There
* are two spaces between each column. */
selected
=
(
fileline
/
editwinrows
)
*
(
editwinrows
*
width
)
+
(
mouse_y
*
width
)
+
(
mouse_x
/
(
longest
+
2
));
selected
=
(
fileline
/
editwinrows
)
*
(
editwinrows
*
width
)
+
(
mouse_y
*
width
)
+
(
mouse_x
/
(
longest
+
2
));
/* If they clicked beyond the end of a row,
* select the last filename in that row. */
if
(
mouse_x
>
width
*
(
longest
+
2
))
selected
--
;
/* If we're
off the screen
, select the last filename. */
/* If we're
beyond the list
, select the last filename. */
if
(
selected
>
filelist_len
-
1
)
selected
=
filelist_len
-
1
;
/* If we selected the same filename as last time,
* p
ut back
the Enter key so that
it'
s read in. */
/* If we selected the same filename as last time,
fake a
* p
ress of
the Enter key so that
the file i
s read in. */
if
(
old_selected
==
selected
)
unget_kbinput
(
sc_seq_or
(
do_enter
,
0
),
FALSE
,
FALSE
);
}
...
...
@@ -202,7 +200,7 @@ char *do_browser(char *path, DIR *dir)
}
else
if
(
func
==
do_last_file
)
{
selected
=
filelist_len
-
1
;
}
else
if
(
func
==
goto_dir_void
)
{
/*
Go to a specific
directory. */
/*
Ask for the
directory
to go to
. */
i
=
do_prompt
(
TRUE
,
#ifndef DISABLE_TABCOMP
FALSE
,
...
...
@@ -248,8 +246,7 @@ char *do_browser(char *path, DIR *dir)
dir
=
opendir
(
new_path
);
if
(
dir
==
NULL
)
{
/* We can't open this directory for some reason.
* Complain. */
/* We can't open this directory for some reason. */
statusbar
(
_
(
"Error reading %s: %s"
),
answer
,
strerror
(
errno
));
beep
();
...
...
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