mirror of
https://github.com/junegunn/fzf.git
synced 2026-10-08 13:05:22 +08:00
Treat a single-character delimiter as a plain string delimiter
even if it's a regular expression meta-character Close #4170
This commit is contained in:
3 files changed
+18
-5
No files matched your search
+6
-2
@@ -9,9 +9,13 @@ import (
|
||||
)
|
||||
|
||||
func TestDelimiterRegex(t *testing.T) {
|
||||
// Valid regex
|
||||
// Valid regex, but a single character -> string
|
||||
delim := delimiterRegexp(".")
|
||||
if delim.regex == nil || delim.str != nil {
|
||||
if delim.regex != nil || *delim.str != "." {
|
||||
t.Error(delim)
|
||||
}
|
||||
delim = delimiterRegexp("|")
|
||||
if delim.regex != nil || *delim.str != "|" {
|
||||
t.Error(delim)
|
||||
}
|
||||
// Broken regex -> string
|
||||
|
||||
Reference in new issue
Block a user