1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//! Auto-close pair rules. The fixed pair set and the character predicates the
//! type/backspace verbs consult; the stateful guards (provenance, quote-parity)
//! live on [`Document`](crate::Document) because they need the buffer to decide.
//!
//! Pair set: `()`, `[]`, `{}`, `""` — the universal bracket set plus string
//! quotes. Every pair char is single-byte ASCII, so a byte offset and a char
//! offset coincide at a pair and no multi-byte handling is needed here.
/// The closing char for an opener, or `None` if `open` isn't a pair opener.
pub
/// Whether `ch` is a closing char of the pair set. Consulted when the caret
/// sits just before `ch` (to decide whether typing that closer should overtype
/// it rather than insert a duplicate).
pub
/// Whether `ch` is a quote. Quotes carry extra guards the bracket pairs don't,
/// since a quote is its own opener and closer and must not auto-close in the
/// middle of a word or against an already-open quote.
pub
/// Word-char test for the quote guard — delegates to the one owner,
/// [`crate::movement::is_word_char`], so the auto-close and word-motion notions
/// of a word boundary stay identical.
pub