mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-26 02:02:14 +02:00
hints kitten: Switch to using a regex engine that supports lookaround
Note that we loose unicode char matching for --type=word because of https://github.com/dlclark/regexp2/issues/65 and of course user regexps cant use \p{N} escapes any more. Hopefully regexp2 will add support for these soon-ish. IMO lookaround is more important than \p. Fixes #6265
This commit is contained in:
@@ -111,6 +111,14 @@ func TestHintMarking(t *testing.T) {
|
||||
opts.Type = "regex"
|
||||
opts.Regex = `(?ms)^[*]?\s(\S+)`
|
||||
r(`* 2b687c2 - test1`, `2b687c2`)
|
||||
opts.Regex = `(?<=got: )sha256.{4}`
|
||||
r(`got: sha256-L8=`, `sha256-L8=`)
|
||||
|
||||
reset()
|
||||
opts.Type = "word"
|
||||
r(`#one (two) 😍 a-1b `, `#one`, `two`, `a-1b`)
|
||||
// non-ascii words dont match because of https://github.com/dlclark/regexp2/issues/65
|
||||
// r(`fōtiz час`, `fōtiz`, `час`)
|
||||
|
||||
reset()
|
||||
tdir := t.TempDir()
|
||||
|
||||
Reference in New Issue
Block a user