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
d9d8eb24
Commit
d9d8eb24
authored
8 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
tweaks: straighten out the flow of a loop
parent
d9aad921
master
feature/match-parens
refactor/readbility
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/browser.c
+18
-21
src/browser.c
with
18 additions
and
21 deletions
+18
-21
src/browser.c
View file @
d9d8eb24
...
...
@@ -72,9 +72,6 @@ char *do_browser(char *path)
read_directory_contents:
/* We come here when we refresh or select a new directory. */
/* Start with no key pressed. */
kbinput
=
ERR
;
path
=
mallocstrassn
(
path
,
get_full_path
(
newpath
?
newpath
:
path
));
if
(
path
!=
NULL
&&
newpath
!=
NULL
)
...
...
@@ -128,30 +125,15 @@ char *do_browser(char *path)
bottombars
(
MBROWSER
);
#ifndef NANO_TINY
/* If the window resized, also refresh the file list. */
if
(
kbinput
==
KEY_WINCH
)
{
/* Remember the selected file, to be able to reselect it. */
present_name
=
strdup
(
filelist
[
selected
]);
/* Reread the contents of the current directory. */
newpath
=
strdup
(
present_path
);
goto
read_directory_contents
;
}
#endif
/* Display (or redisplay) the file list if we don't have a key yet,
* or the list has changed, or the selected file has changed. */
if
(
kbinput
==
ERR
||
old_selected
!=
selected
)
/* Display (or redisplay) the file list if the list itself or
* the selected file has changed. */
if
(
old_selected
!=
selected
)
browser_refresh
();
old_selected
=
selected
;
kbinput
=
get_kbinput
(
edit
);
#ifndef NANO_TINY
if
(
kbinput
==
KEY_WINCH
)
continue
;
#endif
#ifndef DISABLE_MOUSE
if
(
kbinput
==
KEY_MOUSE
)
{
int
mouse_x
,
mouse_y
;
...
...
@@ -340,8 +322,23 @@ char *do_browser(char *path)
}
else
if
(
func
==
do_exit
)
{
/* Exit from the file browser. */
break
;
#ifndef NANO_TINY
}
else
if
(
kbinput
==
KEY_WINCH
)
{
;
#endif
}
else
unbound_key
(
kbinput
);
#ifndef NANO_TINY
/* If the window resized, refresh the file list. */
if
(
kbinput
==
KEY_WINCH
)
{
/* Remember the selected file, to be able to reselect it. */
present_name
=
strdup
(
filelist
[
selected
]);
/* Reread the contents of the current directory. */
newpath
=
strdup
(
present_path
);
goto
read_directory_contents
;
}
#endif
}
titlebar
(
NULL
);
...
...
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