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
0d5fbfb9
Commit
0d5fbfb9
authored
8 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
tweaks: reshuffle some things, and remove a misplaced comment
parent
56147434
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/prompt.c
+13
-20
src/prompt.c
with
13 additions
and
20 deletions
+13
-20
src/prompt.c
View file @
0d5fbfb9
...
...
@@ -28,9 +28,9 @@
static
char
*
prompt
=
NULL
;
/* The prompt string used for statusbar questions. */
static
size_t
statusbar_x
=
(
size_t
)
-
1
;
static
size_t
statusbar_x
=
HIGHEST_POSITIVE
;
/* The cursor position in answer. */
static
size_t
statusbar_pww
=
(
size_t
)
-
1
;
static
size_t
statusbar_pww
=
HIGHEST_POSITIVE
;
/* The place we want in answer. */
/* Read in a character, interpret it as a shortcut or toggle if
...
...
@@ -106,8 +106,7 @@ int do_statusbar_input(bool *ran_func, bool *finished,
/* If we got a shortcut, or if there aren't any other characters
* waiting after the one we read in, we need to display all the
* characters in the input buffer if it isn't empty. */
if
(
have_shortcut
||
get_key_buffer_len
()
==
0
)
{
if
(
kbinput
!=
NULL
)
{
if
((
have_shortcut
||
get_key_buffer_len
()
==
0
)
&&
kbinput
!=
NULL
)
{
/* Display all the characters in the input buffer at
* once, filtering out control characters. */
do_statusbar_output
(
kbinput
,
kbinput_len
,
TRUE
,
NULL
);
...
...
@@ -116,9 +115,10 @@ int do_statusbar_input(bool *ran_func, bool *finished,
kbinput_len
=
0
;
free
(
kbinput
);
kbinput
=
NULL
;
}
}
if
(
have_shortcut
)
{
if
(
have_shortcut
)
{
if
(
s
->
scfunc
==
do_tab
||
s
->
scfunc
==
do_enter
)
;
else
if
(
s
->
scfunc
==
total_refresh
)
{
...
...
@@ -181,7 +181,6 @@ int do_statusbar_input(bool *ran_func, bool *finished,
}
*
finished
=
TRUE
;
}
}
}
return
input
;
...
...
@@ -445,8 +444,8 @@ size_t get_statusbar_page_start(size_t start_col, size_t column)
/* Reinitialize the cursor position in the status bar prompt. */
void
reinit_statusbar_x
(
void
)
{
statusbar_x
=
(
size_t
)
-
1
;
statusbar_pww
=
(
size_t
)
-
1
;
statusbar_x
=
HIGHEST_POSITIVE
;
statusbar_pww
=
HIGHEST_POSITIVE
;
}
/* Put the cursor in the statusbar prompt at statusbar_x. */
...
...
@@ -559,13 +558,8 @@ functionptrtype get_prompt_string(int *actual, bool allow_tabs,
wnoutrefresh
(
edit
);
wnoutrefresh
(
bottomwin
);
/* If we're using restricted mode, we aren't allowed to change the
* name of the current file once it has one, because that would
* allow writing to files not specified on the command line. In
* this case, disable all keys that would change the text if the
* filename isn't blank and we're at the "Write File" prompt. */
while
(
TRUE
)
{
/* Ensure the cursor is
o
n when waiting for input. */
/* Ensure the cursor is
show
n when waiting for input. */
curs_set
(
1
);
kbinput
=
do_statusbar_input
(
&
ran_func
,
&
finished
,
refresh_func
);
...
...
@@ -724,10 +718,9 @@ int do_prompt(bool allow_tabs,
size_t
was_statusbar_x
=
statusbar_x
;
size_t
was_pww
=
statusbar_pww
;
prompt
=
charalloc
((
COLS
*
mb_cur_max
())
+
1
);
bottombars
(
menu
);
prompt
=
charalloc
((
COLS
*
mb_cur_max
())
+
1
);
va_start
(
ap
,
msg
);
vsnprintf
(
prompt
,
COLS
*
mb_cur_max
(),
msg
,
ap
);
va_end
(
ap
);
...
...
@@ -737,11 +730,11 @@ int do_prompt(bool allow_tabs,
#ifndef DISABLE_TABCOMP
allow_files
,
&
listed
,
#endif
curranswer
,
curranswer
,
#ifndef DISABLE_HISTORIES
history_list
,
history_list
,
#endif
refresh_func
);
refresh_func
);
free
(
prompt
);
prompt
=
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