mirror of
https://github.com/makew0rld/amfora.git
synced 2024-09-11 05:55:27 +03:00
updated tag regex and compiled it once globally
This commit is contained in:
parent
84767a39fa
commit
eaf4460134
@ -31,6 +31,7 @@ var bottomBar = cview.NewInputField()
|
|||||||
|
|
||||||
var originalText []byte
|
var originalText []byte
|
||||||
var searchBar = cview.NewInputField()
|
var searchBar = cview.NewInputField()
|
||||||
|
var tagsRegex = regexp.MustCompile(`\[[a-zA-Z0-9_,;: \-\."#]+[^\[]*\]`)
|
||||||
var searchString = ""
|
var searchString = ""
|
||||||
var matches = 0
|
var matches = 0
|
||||||
var curMatch = 0
|
var curMatch = 0
|
||||||
@ -295,7 +296,6 @@ func Init(version, commit, builtBy string) {
|
|||||||
searchIdx := searchRegex.FindAllIndex(originalText, -1)
|
searchIdx := searchRegex.FindAllIndex(originalText, -1)
|
||||||
|
|
||||||
// find all positions of tags
|
// find all positions of tags
|
||||||
tagsRegex := regexp.MustCompile(`\[.*?[^\[]\]`)
|
|
||||||
tagsIdx := tagsRegex.FindAllIndex(originalText, -1)
|
tagsIdx := tagsRegex.FindAllIndex(originalText, -1)
|
||||||
|
|
||||||
text := []byte("")
|
text := []byte("")
|
||||||
|
Loading…
Reference in New Issue
Block a user