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
7a274d62
Commit
7a274d62
authored
8 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
binding: use arrows instead of words to designate the cursor keys
parent
fdee0df8
master
feature/match-parens
refactor/readbility
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/global.c
+22
-8
src/global.c
src/help.c
+5
-1
src/help.c
with
27 additions
and
9 deletions
+27
-9
src/global.c
View file @
7a274d62
...
...
@@ -412,13 +412,17 @@ void assign_keyinfo(sc *s, const char *keystring)
if
(
keystring
[
0
]
==
'^'
)
{
if
(
strcasecmp
(
keystring
,
"^Space"
)
==
0
)
s
->
keycode
=
0
;
else
if
(
strcasecmp
(
keystring
,
"^Left"
)
==
0
)
else
if
(
strcasecmp
(
keystring
,
"^Left"
)
==
0
||
strcasecmp
(
keystring
,
"^^
\xE2\x86\x90
"
)
==
0
)
s
->
keycode
=
CONTROL_LEFT
;
else
if
(
strcasecmp
(
keystring
,
"^Right"
)
==
0
)
else
if
(
strcasecmp
(
keystring
,
"^Right"
)
==
0
||
strcasecmp
(
keystring
,
"^^
\xE2\x86\x92
"
)
==
0
)
s
->
keycode
=
CONTROL_RIGHT
;
else
if
(
strcasecmp
(
keystring
,
"^Up"
)
==
0
)
else
if
(
strcasecmp
(
keystring
,
"^Up"
)
==
0
||
strcasecmp
(
keystring
,
"^^
\xE2\x86\x91
"
)
==
0
)
s
->
keycode
=
CONTROL_UP
;
else
if
(
strcasecmp
(
keystring
,
"^Down"
)
==
0
)
else
if
(
strcasecmp
(
keystring
,
"^Down"
)
==
0
||
strcasecmp
(
keystring
,
"^^
\xE2\x86\x93
"
)
==
0
)
s
->
keycode
=
CONTROL_DOWN
;
else
s
->
keycode
=
keystring
[
1
]
-
64
;
...
...
@@ -1122,8 +1126,13 @@ void shortcut_init(void)
add_to_sclist
(
MMOST
,
"Left"
,
do_left
,
0
);
add_to_sclist
(
MMOST
,
"^F"
,
do_right
,
0
);
add_to_sclist
(
MMOST
,
"Right"
,
do_right
,
0
);
add_to_sclist
(
MMOST
,
"^Left"
,
do_prev_word_void
,
0
);
add_to_sclist
(
MMOST
,
"^Right"
,
do_next_word_void
,
0
);
if
(
using_utf8
())
{
add_to_sclist
(
MMAIN
,
"^
\xE2\x86\x90
"
,
do_prev_word_void
,
0
);
add_to_sclist
(
MMAIN
,
"^
\xE2\x86\x92
"
,
do_next_word_void
,
0
);
}
else
{
add_to_sclist
(
MMOST
,
"^Left"
,
do_prev_word_void
,
0
);
add_to_sclist
(
MMOST
,
"^Right"
,
do_next_word_void
,
0
);
}
add_to_sclist
(
MMOST
,
"M-Space"
,
do_prev_word_void
,
0
);
add_to_sclist
(
MMOST
,
"^Space"
,
do_next_word_void
,
0
);
add_to_sclist
((
MMOST
&
~
MBROWSER
),
"^A"
,
do_home
,
0
);
...
...
@@ -1134,8 +1143,13 @@ void shortcut_init(void)
add_to_sclist
(
MMAIN
|
MHELP
|
MBROWSER
,
"Up"
,
do_up_void
,
0
);
add_to_sclist
(
MMAIN
|
MHELP
|
MBROWSER
,
"^N"
,
do_down_void
,
0
);
add_to_sclist
(
MMAIN
|
MHELP
|
MBROWSER
,
"Down"
,
do_down_void
,
0
);
add_to_sclist
(
MMAIN
,
"^Up"
,
do_prev_block
,
0
);
add_to_sclist
(
MMAIN
,
"^Down"
,
do_next_block
,
0
);
if
(
using_utf8
())
{
add_to_sclist
(
MMAIN
,
"^
\xE2\x86\x91
"
,
do_prev_block
,
0
);
add_to_sclist
(
MMAIN
,
"^
\xE2\x86\x93
"
,
do_next_block
,
0
);
}
else
{
add_to_sclist
(
MMAIN
,
"^Up"
,
do_prev_block
,
0
);
add_to_sclist
(
MMAIN
,
"^Down"
,
do_next_block
,
0
);
}
add_to_sclist
(
MMAIN
,
"M-7"
,
do_prev_block
,
0
);
add_to_sclist
(
MMAIN
,
"M-8"
,
do_next_block
,
0
);
#ifndef DISABLE_JUSTIFY
...
...
This diff is collapsed.
Click to expand it.
src/help.c
View file @
7a274d62
...
...
@@ -419,7 +419,11 @@ void help_init(void)
* but allow it to spill into the second, for "M-Space". */
if
(
scsfound
==
1
)
{
sprintf
(
ptr
,
"%s "
,
s
->
keystr
);
ptr
+=
6
;
/* Unicode arrows take three bytes instead of one. */
if
(
s
->
keystr
[
1
]
==
'\xE2'
)
ptr
+=
8
;
else
ptr
+=
6
;
}
else
{
ptr
+=
sprintf
(
ptr
,
"(%s)
\t
"
,
s
->
keystr
);
break
;
...
...
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