mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-25 18:07:07 +09:00
options: add matchbracestyle (#2876)
* Update docs to include `matchbracestyle` * Add `matchbracestyle` to infocomplete.go * Add validator and default settings for `matchbracestyle` * Highlight or underline braces based on `matchbracestyle` * Add `match-brace` to default colorschemes * Correct `FindMatchingBrace()` counting Make brace under the cursor have priority over brace to the left in ambiguous cases when matching braces Co-authored-by: Dmitry Maluka <dmitrymaluka@gmail.com> * Fix conflicts --------- Co-authored-by: Jöran Karl <3951388+JoeKar@users.noreply.github.com> Co-authored-by: Dmitry Maluka <dmitrymaluka@gmail.com>
This commit is contained in:
@@ -407,7 +407,9 @@ func (w *BufWindow) displayBuffer() {
|
||||
if found {
|
||||
matchingBraces = append(matchingBraces, mb)
|
||||
if !left {
|
||||
matchingBraces = append(matchingBraces, curLoc)
|
||||
if b.Settings["matchbracestyle"].(string) != "highlight" {
|
||||
matchingBraces = append(matchingBraces, curLoc)
|
||||
}
|
||||
} else {
|
||||
matchingBraces = append(matchingBraces, curLoc.Move(-1, b))
|
||||
}
|
||||
@@ -557,7 +559,15 @@ func (w *BufWindow) displayBuffer() {
|
||||
|
||||
for _, mb := range matchingBraces {
|
||||
if mb.X == bloc.X && mb.Y == bloc.Y {
|
||||
style = style.Underline(true)
|
||||
if b.Settings["matchbracestyle"].(string) == "highlight" {
|
||||
if s, ok := config.Colorscheme["match-brace"]; ok {
|
||||
style = s
|
||||
} else {
|
||||
style = style.Reverse(true)
|
||||
}
|
||||
} else {
|
||||
style = style.Underline(true)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user