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
0cf455bc
Commit
0cf455bc
authored
7 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
build: fix compilation when configured with --enable-tiny
And when configured with --enable-tiny --enable-nanorc.
parent
3e1fc638
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/global.c
+4
-0
src/global.c
src/nano.h
+2
-0
src/nano.h
src/rcfile.c
+4
-0
src/rcfile.c
with
10 additions
and
0 deletions
+10
-0
src/global.c
View file @
0cf455bc
...
...
@@ -318,9 +318,11 @@ void flip_newbuffer(void)
void
discard_buffer
(
void
)
{
}
#ifdef ENABLE_NANORC
void
implant
(
void
)
{
}
#endif
/* Add a function to the function list. */
void
add_to_funcs
(
void
(
*
func
)(
void
),
int
menus
,
const
char
*
desc
,
const
char
*
help
,
...
...
@@ -1385,11 +1387,13 @@ void set_spell_shortcuts(void)
/* Execute the function of the given shortcut. */
void
execute
(
const
sc
*
shortcut
)
{
#ifdef ENABLE_NANORC
if
(
shortcut
->
scfunc
==
implant
)
/* Insert the corresponding string into the keyboard buffer. */
for
(
int
i
=
strlen
(
shortcut
->
expansion
);
i
>
0
;
i
--
)
put_back
(
shortcut
->
expansion
[
i
-
1
]);
else
#endif
shortcut
->
scfunc
();
}
...
...
This diff is collapsed.
Click to expand it.
src/nano.h
View file @
0cf455bc
...
...
@@ -439,6 +439,8 @@ typedef struct sc {
int
ordinal
;
/* The how-manieth toggle this is, in order to be able to
* keep them in sequence. */
#endif
#ifdef ENABLE_NANORC
char
*
expansion
;
/* The string of keycodes to which this shortcut is expanded. */
#endif
...
...
This diff is collapsed.
Click to expand it.
src/rcfile.c
View file @
0cf455bc
...
...
@@ -335,6 +335,8 @@ bool is_universal(void (*func)(void))
func
==
do_home
||
func
==
do_end
||
#ifndef NANO_TINY
func
==
do_prev_word_void
||
func
==
do_next_word_void
||
#endif
#ifndef ENABLE_NANORC
func
==
implant
||
#endif
func
==
do_delete
||
func
==
do_backspace
||
...
...
@@ -420,7 +422,9 @@ void parse_binding(char *ptr, bool dobind)
newsc
=
nmalloc
(
sizeof
(
sc
));
newsc
->
scfunc
=
implant
;
newsc
->
expansion
=
mallocstrcpy
(
NULL
,
funcptr
+
1
);
#ifndef NANO_TINY
newsc
->
toggle
=
0
;
#endif
}
else
newsc
=
strtosc
(
funcptr
);
...
...
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