From a494f47a5df543a3ab8d6530a5acbc2a5bd04d44 Mon Sep 17 00:00:00 2001 From: Skyler Hawthorne Date: Fri, 25 Feb 2022 03:36:54 -0500 Subject: Configurable auto pairs (#1624) * impl auto pairs config Implements configuration for which pairs of tokens get auto completed. In order to help with this, the logic for when *not* to auto complete has been generalized from a specific hardcoded list of characters to simply testing if the next/prev char is alphanumeric. It is possible to configure a global list of pairs as well as at the language level. The language config will take precedence over the global config. * rename AutoPair -> Pair * clean up insert_char command * remove Rc * remove some explicit cloning with another impl * fix lint * review comments * global auto-pairs = false takes precedence over language settings * make clippy happy * print out editor config on startup * move auto pairs accessor into Document * rearrange auto pair doc comment * use pattern in Froms--- helix-core/src/indent.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'helix-core/src/indent.rs') diff --git a/helix-core/src/indent.rs b/helix-core/src/indent.rs index 5d20edc1..9a329d95 100644 --- a/helix-core/src/indent.rs +++ b/helix-core/src/indent.rs @@ -442,6 +442,7 @@ where indent_query: OnceCell::new(), textobject_query: OnceCell::new(), debugger: None, + auto_pairs: None, }], }); -- cgit v1.2.3-70-g09d2