From 05f9a8832254b33c0f18dd08385ba5056276f408 Mon Sep 17 00:00:00 2001 From: gspc Date: Wed, 30 Nov 2016 21:42:45 +0530 Subject: [PATCH 6/6] disabled wordcompletion when configured with nano-tiny --- src/global.c | 2 ++ src/nano.c | 5 ++++- src/nano.h | 2 ++ src/proto.h | 2 ++ src/text.c | 4 ++++ 5 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/global.c b/src/global.c index 6ccbec9..233dea7 100644 --- a/src/global.c +++ b/src/global.c @@ -59,8 +59,10 @@ int last_line_y; message_type lastmessage = HUSH; /* Messages of type HUSH should not overwrite type MILD nor ALERT. */ +#ifndef NANO_TINY filestruct *pletion_line = NULL; /* The line where the last completion was found, if any. */ +#endif int controlleft, controlright, controlup, controldown; #ifndef NANO_TINY diff --git a/src/nano.c b/src/nano.c index a84f9de..964b1b3 100644 --- a/src/nano.c +++ b/src/nano.c @@ -1682,8 +1682,11 @@ int do_input(bool allow_funcs) } } - if (!have_shortcut) + if (!have_shortcut) { +#ifndef NANO_TINY pletion_line = NULL; +#endif + } else { const subnfunc *f = sctofunc(s); diff --git a/src/nano.h b/src/nano.h index 08d3b21..beb6afe 100644 --- a/src/nano.h +++ b/src/nano.h @@ -484,10 +484,12 @@ typedef struct subnfunc { /* Next item in the list. */ } subnfunc; +#ifndef NANO_TINY typedef struct completion_word { char *word; struct completion_word *next; } completion_word; +#endif /* The elements of the interface that can be colored differently. */ enum diff --git a/src/proto.h b/src/proto.h index 68032db..7c3eb25 100644 --- a/src/proto.h +++ b/src/proto.h @@ -47,7 +47,9 @@ extern int last_line_y; extern message_type lastmessage; +#ifndef NANO_TINY extern filestruct *pletion_line; +#endif extern int controlleft; extern int controlright; diff --git a/src/text.c b/src/text.c index b506310..0607c4e 100644 --- a/src/text.c +++ b/src/text.c @@ -48,10 +48,12 @@ static filestruct *jusbottom = NULL; /* A pointer to the end of the buffer with unjustified text. */ #endif +#ifndef NANO_TINY static int pletion_x = 0; /* The x position in pletion_line of the last found completion. */ static completion_word *list_of_completions; /* A linked list of the completions that have been attepmted. */ +#endif #ifndef NANO_TINY /* Toggle the mark. */ @@ -3690,6 +3692,7 @@ void do_verbatim_input(void) free(output); } +#ifndef NANO_TINY /* Copy the found completion candidate. */ char *copy_completion(char *check_line, int start) { @@ -3861,3 +3864,4 @@ void complete_a_word(void) free(shard); } +#endif -- 1.9.1