Jesse Portnoy
|
d9ba8dbabb
|
.git/config is just an INI file and the lexer for INI is acutally better so... deleting.
|
2023-07-17 14:10:26 +01:00 |
|
Jesse Portnoy
|
90e6641fc5
|
.
|
2023-07-17 04:00:50 +01:00 |
|
Jesse Portnoy
|
e41cefacba
|
Double '||'.. hard to spot, causes a mess
|
2023-07-17 03:45:35 +01:00 |
|
Jesse Portnoy
|
571529568c
|
- Revised code example
- Added new lexers and revised existing
|
2023-07-16 23:44:37 +01:00 |
|
Jesse Portnoy
|
3e2e307e62
|
Merge branch 'helper-method-to-parse-syntax-files'
|
2023-07-16 17:31:59 +01:00 |
|
Jesse Portnoy
|
e93520cea4
|
Fix example to use the new parse helper function
|
2023-07-16 17:21:03 +01:00 |
|
Jesse Portnoy
|
00bc494d7b
|
Merge branch 'helper-method-to-parse-syntax-files' of github.com:jessp01/highlight into helper-method-to-parse-syntax-files
|
2023-07-16 17:05:44 +01:00 |
|
Jesse Portnoy
|
c255706700
|
.
|
2023-07-16 17:03:46 +01:00 |
|
Jesse Portnoy
|
8969d1f05a
|
.
|
2023-07-16 17:03:21 +01:00 |
|
Jesse Portnoy
|
8e81b0cb4d
|
Fixes.
|
2023-07-16 17:01:33 +01:00 |
|
Jesse Portnoy
|
28dec9874b
|
Fixes.
|
2023-07-16 17:00:58 +01:00 |
|
Jesse Portnoy
|
9bebc7ad73
|
Merge branch 'synlink-yaml-to-yml'
|
2023-07-16 16:39:09 +01:00 |
|
Jesse Portnoy
|
5d44bdc87e
|
Merge branch 'protect-against-a-case-where-rules-are-nil'
|
2023-07-16 16:38:25 +01:00 |
|
Jesse Portnoy
|
9ebe0cb27f
|
Merge branch 'fix-sh-brackets-detection'
|
2023-07-16 16:37:07 +01:00 |
|
Jesse Portnoy
|
0606b69176
|
Helper method to parse syntax files
|
2023-07-16 16:26:54 +01:00 |
|
Jesse Portnoy
|
92d5b017bb
|
Fix sh brackets detection
|
2023-07-16 16:15:29 +01:00 |
|
Jesse Portnoy
|
b5b98d2281
|
In highlightEmptyRegion(), if no rules are defined, return
immediately.
The following snippet will trigger SIGSEGV otherwise:
```go
syntaxFile, _ := ioutil.ReadFile("/non/existing/path" + "yml.yaml")
syntaxDef, err := highlight.ParseDef(syntaxFile)
if err != nil {
return err
}
h := highlight.NewHighlighter(syntaxDef)
matches := h.HighlightString(string(codeBlock.Literal))
```
```
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x574656]
goroutine 1 [running]:
github.com/zyedidia/highlight.(*Highlighter).highlightEmptyRegion(0xc000129b98, 0xc0000db980?, 0x0, 0x1, 0x0?, {0xc0001880b0, 0x2a, 0x2c}, 0x0)
/home/jesse/go/pkg/mod/github.com/zyedidia/highlight@v0.0.0-20200217010119-291680feaca1/highlighter.go:215 +0x96
github.com/zyedidia/highlight.(*Highlighter).HighlightString(0xc000129b98, {0xc0000db980?, 0x2b?})
/home/jesse/go/pkg/mod/github.com/zyedidia/highlight@v0.0.0-20200217010119-291680feaca1/highlighter.go:278 +0x130
```
|
2023-07-16 02:17:04 +01:00 |
|
Jesse Portnoy
|
5fa7eb841e
|
- Guard aginst non-existing syn highlighter file
- Create mod file in `examples` dir
|
2023-07-16 02:12:12 +01:00 |
|
Jesse Portnoy
|
fe2757664e
|
Symlink yml.yaml (bpth forms are generally valid by other highlighters)
|
2023-07-16 01:43:47 +01:00 |
|