commit 5111b20bf501b0b00766de4411684a38f911f2f7
parent f571d6ba366bc002737b2b096a7cee1f986a760a
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Wed, 22 Jan 2020 12:55:32 +0100
build: exclude bracketed pasting from the tiny version
Diffstat:
3 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/src/global.c b/src/global.c
@@ -1408,9 +1408,10 @@ void shortcut_init(void)
#ifdef ENABLE_SPELLER
add_to_sclist(MMAIN, "F12", KEY_F(12), do_spell, 0);
#endif
-
+#ifndef NANO_TINY
/* Catch and ignore bracketed paste marker keys. */
add_to_sclist(MMOST|MHELP|MBROWSER|MYESNO, "", BRACKETED_PASTE_MARKER, do_nothing, 0);
+#endif
}
#ifndef NANO_TINY
diff --git a/src/nano.c b/src/nano.c
@@ -310,10 +310,10 @@ void restore_terminal(void)
{
curs_set(1);
endwin();
-
+#ifndef NANO_TINY
printf("\e[?2004l");
fflush(stdout);
-
+#endif
tcsetattr(0, TCSANOW, &original_state);
}
@@ -1447,6 +1447,7 @@ bool okay_for_view(const keystruct *shortcut)
return (item == NULL || item->viewok);
}
+#ifndef NANO_TINY
/* Read in all waiting input bytes and paste them into the buffer in one go. */
void suck_up_input_and_paste_it(void)
{
@@ -1480,6 +1481,7 @@ void suck_up_input_and_paste_it(void)
cutbuffer = was_cutbuffer;
}
+#endif
/* Read in a keystroke. Act on the keystroke if it is a shortcut or a toggle;
* otherwise, insert it into the edit buffer. */
@@ -1637,8 +1639,10 @@ void do_input(void)
shortcut->func == do_backspace))
update_line(openfile->current, openfile->current_x);
+#ifndef NANO_TINY
if (bracketed_paste)
suck_up_input_and_paste_it();
+#endif
}
/* The user typed output_len multibyte characters. Add them to the edit
diff --git a/src/winio.c b/src/winio.c
@@ -1095,6 +1095,7 @@ int convert_sequence(const int *seq, size_t length, int *consumed)
/* Discard broken sequences that Slang produces. */
*consumed = 4;
#endif
+#ifndef NANO_TINY
else if (length > 4 && seq[2] == '0' && seq[4] == '~') {
/* Esc [ 2 0 0 ~ == start of a bracketed paste,
* Esc [ 2 0 1 ~ == end of a bracketed paste. */
@@ -1107,6 +1108,7 @@ int convert_sequence(const int *seq, size_t length, int *consumed)
return BRACKETED_PASTE_MARKER;
}
}
+#endif
break;
case '3': /* Esc [ 3 ~ == Delete on VT220/VT320/
* Linux console/xterm/Terminal. */