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
a9b5a0e0
Commit
a9b5a0e0
authored
8 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
tweaks: rename a function to something less abbrevy
Also, swap the logic around, to use less braces.
parent
026393a9
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
src/browser.c
+1
-1
src/browser.c
src/global.c
+8
-9
src/global.c
src/prompt.c
+2
-2
src/prompt.c
src/proto.h
+1
-1
src/proto.h
src/winio.c
+4
-4
src/winio.c
with
16 additions
and
17 deletions
+16
-17
src/browser.c
View file @
a9b5a0e0
...
...
@@ -147,7 +147,7 @@ char *do_browser(char *path)
/* If we selected the same filename as last time, fake a
* press of the Enter key so that the file is read in. */
if
(
old_selected
==
selected
)
unget_kbinput
(
sc_seq_
or
(
do_enter
,
0
),
FALSE
);
unget_kbinput
(
the_code_f
or
(
do_enter
,
0
),
FALSE
);
}
continue
;
...
...
This diff is collapsed.
Click to expand it.
src/global.c
View file @
a9b5a0e0
...
...
@@ -385,18 +385,17 @@ const sc *first_sc_for(int menu, void (*func)(void))
return
NULL
;
}
/* Return the
given menu's first shortcut sequence, or the default valu
e
*
(2nd arg). Assumes currmenu for the menu to check
. */
int
sc_seq_
or
(
void
(
*
func
)(
void
),
int
defaultval
)
/* Return the
first keycode that is bound to the given function in th
e
*
current menu, if any; otherwise, return the given default value
. */
int
the_code_f
or
(
void
(
*
func
)(
void
),
int
defaultval
)
{
const
sc
*
s
=
first_sc_for
(
currmenu
,
func
);
if
(
s
)
{
meta_key
=
s
->
meta
;
return
s
->
keycode
;
}
/* else */
return
defaultval
;
if
(
s
==
NULL
)
return
defaultval
;
meta_key
=
s
->
meta
;
return
s
->
keycode
;
}
/* Return a pointer to the function that is bound to the given key. */
...
...
This diff is collapsed.
Click to expand it.
src/prompt.c
View file @
a9b5a0e0
...
...
@@ -148,7 +148,7 @@ int do_statusbar_input(bool *ran_func, bool *finished)
* fake a press of Enter, and indicate that we're done. */
if
(
got_newline
)
{
get_input
(
NULL
,
1
);
input
=
sc_seq_
or
(
do_enter
,
0
);
input
=
the_code_f
or
(
do_enter
,
0
);
*
finished
=
TRUE
;
}
}
else
if
(
s
->
scfunc
==
do_cut_text_void
)
...
...
@@ -531,7 +531,7 @@ functionptrtype acquire_an_answer(int *actual, bool allow_tabs,
if
(
func
==
do_tab
)
{
#ifndef DISABLE_HISTORIES
if
(
history_list
!=
NULL
)
{
if
(
last_kbinput
!=
sc_seq_
or
(
do_tab
,
TAB_CODE
))
if
(
last_kbinput
!=
the_code_f
or
(
do_tab
,
TAB_CODE
))
complete_len
=
strlen
(
answer
);
if
(
complete_len
>
0
)
{
...
...
This diff is collapsed.
Click to expand it.
src/proto.h
View file @
a9b5a0e0
...
...
@@ -358,7 +358,7 @@ int check_poshistory(const char *file, ssize_t *line, ssize_t *column);
/* Some functions in global.c. */
size_t
length_of_list
(
int
menu
);
const
sc
*
first_sc_for
(
int
menu
,
void
(
*
func
)(
void
));
int
sc_seq_
or
(
void
(
*
func
)(
void
),
int
defaultval
);
int
the_code_f
or
(
void
(
*
func
)(
void
),
int
defaultval
);
functionptrtype
func_from_key
(
int
*
kbinput
);
void
assign_keyinfo
(
sc
*
s
,
const
char
*
keystring
,
const
int
keycode
);
void
print_sclist
(
void
);
...
...
This diff is collapsed.
Click to expand it.
src/winio.c
View file @
a9b5a0e0
...
...
@@ -642,13 +642,13 @@ int parse_kbinput(WINDOW *win)
#endif
case
DEL_CODE
:
if
(
ISSET
(
REBIND_DELETE
))
return
sc_seq_
or
(
do_delete
,
KEY_DC
);
return
the_code_f
or
(
do_delete
,
KEY_DC
);
else
return
KEY_BACKSPACE
;
#ifdef KEY_SIC
/* Slang doesn't support KEY_SIC. */
case
KEY_SIC
:
return
sc_seq_
or
(
do_insertfile_void
,
KEY_IC
);
return
the_code_f
or
(
do_insertfile_void
,
KEY_IC
);
#endif
#ifdef KEY_SBEG
/* Slang doesn't support KEY_SBEG. */
...
...
@@ -667,7 +667,7 @@ int parse_kbinput(WINDOW *win)
#endif
/* Slang doesn't support KEY_CANCEL. */
case
KEY_CANCEL
:
return
sc_seq_
or
(
do_cancel
,
0x03
);
return
the_code_f
or
(
do_cancel
,
0x03
);
#endif
#ifdef KEY_SUSPEND
#ifdef KEY_SSUSPEND
...
...
@@ -676,7 +676,7 @@ int parse_kbinput(WINDOW *win)
#endif
/* Slang doesn't support KEY_SUSPEND. */
case
KEY_SUSPEND
:
return
sc_seq_
or
(
do_suspend_void
,
KEY_SUSPEND
);
return
the_code_f
or
(
do_suspend_void
,
KEY_SUSPEND
);
#endif
#ifdef PDCURSES
case
KEY_SHIFT_L
:
...
...
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