From 5bef5486edf43b329cc0c82758e7d40d317c9d36 Mon Sep 17 00:00:00 2001 From: sloum Date: Sun, 9 Feb 2020 09:56:42 -0800 Subject: [PATCH] Adds to the auto parens feature --- hermes.c | 11 ++++++++++- syntaxhl.h | 6 +++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/hermes.c b/hermes.c index 396b010..86d1530 100644 --- a/hermes.c +++ b/hermes.c @@ -361,6 +361,12 @@ char editorGetMatchingParen(char c) { return ')'; case '[': return ']'; + case '"': + return '"'; + case '\'': + return '\''; + case '`': + return '`'; default: return ' '; } @@ -1169,8 +1175,11 @@ void editorInputKp(int c) { case '(': case '{': case '[': + case '\'': + case '"': + case '`': editorInsertChar(c); - if (MATCH_PARENS) { + if (MATCH_PARENS && E.syntax) { char match = editorGetMatchingParen(c); editorInsertChar(match); editorMoveCursor(ARROW_LEFT); diff --git a/syntaxhl.h b/syntaxhl.h index 8b2b96a..6ec2ac8 100644 --- a/syntaxhl.h +++ b/syntaxhl.h @@ -56,12 +56,12 @@ char *PY_HL_keywords[] = { // Go char *GO_HL_keywords[] = { "break", "switch", "continue", "func", "interface", "select", - "case", "defer", "go", "map", "struct", "chan", "else", "goto", + "case", "defer", "go", "map|", "struct", "chan|", "else", "goto", "package", "const", "fallthrough|", "if", "range|", "type", "for", "import", "return", "var", "uint8|", "uint16|", "uint32|", "uint64", "int|", "uint|", "int8|", "int16|", "int32|", "int64|", - "float32|", "float", "float64|", "complex64|", "complex128|", - "byte|", "rune|", "uintptr|", "string|", "bool|", NULL + "float32|", "float|", "float64|", "complex64|", "complex128|", + "byte|", "rune|", "uintptr|", "string|", "bool|", "error|", NULL }; // Shell