build: exclude bracketed pasting from the tiny version

master
Benno Schulenberg 2020-01-22 12:55:32 +01:00
parent f571d6ba36
commit 5111b20bf5
3 changed files with 10 additions and 3 deletions

View File

@ -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

View File

@ -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

View File

@ -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. */