Add url_excluded_characters option to exclude characters from URLs.

This option, like select_by_word_characters, is a set of characters, but
for which to *exclude* from URL parsing. See
https://github.com/kovidgoyal/kitty/issues/3688#issuecomment-862711148.
This commit is contained in:
Radu Butoi
2021-06-16 23:05:47 -04:00
parent 9ec1c28b35
commit 5ee0651f56
7 changed files with 42 additions and 0 deletions

View File

@@ -1,5 +1,6 @@
#pragma once
#include "data-types.h"
#include "state.h"
#define VS15 1285
#define VS16 1286
@@ -13,6 +14,8 @@ combining_type mark_for_codepoint(char_type c);
static inline bool
is_url_char(uint32_t ch) {
for (size_t i = 0; i < OPT(url_excluded_characters_count); i++)
if (ch == OPT(url_excluded_characters)[i]) return false;
return ch && !is_CZ_category(ch);
}