Adds to the auto parens feature
This commit is contained in:
parent
5674c3ae7f
commit
5bef5486ed
11
hermes.c
11
hermes.c
|
@ -361,6 +361,12 @@ char editorGetMatchingParen(char c) {
|
||||||
return ')';
|
return ')';
|
||||||
case '[':
|
case '[':
|
||||||
return ']';
|
return ']';
|
||||||
|
case '"':
|
||||||
|
return '"';
|
||||||
|
case '\'':
|
||||||
|
return '\'';
|
||||||
|
case '`':
|
||||||
|
return '`';
|
||||||
default:
|
default:
|
||||||
return ' ';
|
return ' ';
|
||||||
}
|
}
|
||||||
|
@ -1169,8 +1175,11 @@ void editorInputKp(int c) {
|
||||||
case '(':
|
case '(':
|
||||||
case '{':
|
case '{':
|
||||||
case '[':
|
case '[':
|
||||||
|
case '\'':
|
||||||
|
case '"':
|
||||||
|
case '`':
|
||||||
editorInsertChar(c);
|
editorInsertChar(c);
|
||||||
if (MATCH_PARENS) {
|
if (MATCH_PARENS && E.syntax) {
|
||||||
char match = editorGetMatchingParen(c);
|
char match = editorGetMatchingParen(c);
|
||||||
editorInsertChar(match);
|
editorInsertChar(match);
|
||||||
editorMoveCursor(ARROW_LEFT);
|
editorMoveCursor(ARROW_LEFT);
|
||||||
|
|
|
@ -56,12 +56,12 @@ char *PY_HL_keywords[] = {
|
||||||
// Go
|
// Go
|
||||||
char *GO_HL_keywords[] = {
|
char *GO_HL_keywords[] = {
|
||||||
"break", "switch", "continue", "func", "interface", "select",
|
"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",
|
"package", "const", "fallthrough|", "if", "range|", "type",
|
||||||
"for", "import", "return", "var", "uint8|", "uint16|", "uint32|",
|
"for", "import", "return", "var", "uint8|", "uint16|", "uint32|",
|
||||||
"uint64", "int|", "uint|", "int8|", "int16|", "int32|", "int64|",
|
"uint64", "int|", "uint|", "int8|", "int16|", "int32|", "int64|",
|
||||||
"float32|", "float", "float64|", "complex64|", "complex128|",
|
"float32|", "float|", "float64|", "complex64|", "complex128|",
|
||||||
"byte|", "rune|", "uintptr|", "string|", "bool|", NULL
|
"byte|", "rune|", "uintptr|", "string|", "bool|", "error|", NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
// Shell
|
// Shell
|
||||||
|
|
Loading…
Reference in New Issue