is_visual_escape_seq: whittle down the escape sequences attempted

Some of these we do not need to worry about actually being used
in a prompt.
This commit is contained in:
Aaron Gyes 2019-04-19 16:16:54 -07:00
parent 32ad1a6e62
commit f309ae05b6

View file

@ -214,13 +214,12 @@ static bool is_color_escape_seq(const wchar_t *code, size_t *resulting_length) {
static bool is_visual_escape_seq(const wchar_t *code, size_t *resulting_length) {
if (!cur_term) return false;
const char *const esc2[] = {
enter_bold_mode, exit_attribute_mode, enter_underline_mode, exit_underline_mode,
enter_standout_mode, exit_standout_mode, flash_screen, enter_subscript_mode,
exit_subscript_mode, enter_superscript_mode, exit_superscript_mode, enter_blink_mode,
enter_italics_mode, exit_italics_mode, enter_reverse_mode, enter_shadow_mode,
exit_shadow_mode, enter_standout_mode, exit_standout_mode, enter_secure_mode,
enter_dim_mode, enter_blink_mode, enter_protected_mode, enter_alt_charset_mode,
exit_alt_charset_mode};
enter_bold_mode, exit_attribute_mode, enter_underline_mode, exit_underline_mode,
enter_standout_mode, exit_standout_mode, enter_blink_mode, enter_protected_mode,
enter_italics_mode, exit_italics_mode, enter_reverse_mode, enter_shadow_mode,
exit_shadow_mode, enter_standout_mode, exit_standout_mode, enter_secure_mode,
enter_dim_mode, enter_blink_mode, enter_alt_charset_mode, exit_alt_charset_mode
};
for (size_t p = 0; p < sizeof esc2 / sizeof *esc2; p++) {
if (!esc2[p]) continue;