commit 37ddfa9dbd701e776e545b159821b81b90d184d7
parent 64844b69597ef284590c5f51bc8c62c729d4daa5
Author: David Lawrence Ramsey <pooka109@gmail.com>
Date: Mon, 7 Nov 2005 06:06:05 +0000
move do_verbatim_input() from nano.c to text.c, since it's an advanced
text-based operation
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3096 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
Diffstat:
4 files changed, 34 insertions(+), 30 deletions(-)
diff --git a/ChangeLog b/ChangeLog
@@ -64,6 +64,10 @@ CVS code -
read_file()
- Remove apparently unneeded logic to handle a case where
current is NULL, since it shouldn't be NULL there. (DLR)
+- nano.c:
+ do_verbatim_input()
+ - Move to text.c, since it's an advanced text-based operation.
+ (DLR)
- nano.h:
- Readd MIN_EDITOR_COLS #define. (DLR)
- rcfile.c:
diff --git a/src/nano.c b/src/nano.c
@@ -900,35 +900,6 @@ void nano_disabled_msg(void)
statusbar(_("Sorry, support for this function has been disabled"));
}
-void do_verbatim_input(void)
-{
- int *kbinput;
- size_t kbinput_len, i;
- char *output;
-
- statusbar(_("Verbatim Input"));
-
- /* If constant cursor position display is on, make sure the current
- * cursor position will be properly displayed on the statusbar. */
- if (ISSET(CONST_UPDATE))
- do_cursorpos(TRUE);
-
- /* Read in all the verbatim characters. */
- kbinput = get_verbatim_kbinput(edit, &kbinput_len);
-
- /* Display all the verbatim characters at once, not filtering out
- * control characters. */
- output = charalloc(kbinput_len + 1);
-
- for (i = 0; i < kbinput_len; i++)
- output[i] = (char)kbinput[i];
- output[i] = '\0';
-
- do_output(output, kbinput_len, TRUE);
-
- free(output);
-}
-
void do_exit(void)
{
int i;
diff --git a/src/proto.h b/src/proto.h
@@ -391,7 +391,6 @@ void version(void);
int no_more_space(void);
int no_help(void);
void nano_disabled_msg(void);
-void do_verbatim_input(void);
void do_exit(void);
void signal_init(void);
void handle_hupterm(int signal);
@@ -574,6 +573,7 @@ void do_spell(void);
#ifndef NANO_SMALL
void do_wordlinechar_count(void);
#endif
+void do_verbatim_input(void);
/* Public functions in utils.c. */
int digits(size_t n);
diff --git a/src/text.c b/src/text.c
@@ -2132,3 +2132,32 @@ void do_wordlinechar_count(void)
(unsigned long)chars);
}
#endif /* !NANO_SMALL */
+
+void do_verbatim_input(void)
+{
+ int *kbinput;
+ size_t kbinput_len, i;
+ char *output;
+
+ statusbar(_("Verbatim Input"));
+
+ /* If constant cursor position display is on, make sure the current
+ * cursor position will be properly displayed on the statusbar. */
+ if (ISSET(CONST_UPDATE))
+ do_cursorpos(TRUE);
+
+ /* Read in all the verbatim characters. */
+ kbinput = get_verbatim_kbinput(edit, &kbinput_len);
+
+ /* Display all the verbatim characters at once, not filtering out
+ * control characters. */
+ output = charalloc(kbinput_len + 1);
+
+ for (i = 0; i < kbinput_len; i++)
+ output[i] = (char)kbinput[i];
+ output[i] = '\0';
+
+ do_output(output, kbinput_len, TRUE);
+
+ free(output);
+}