mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-30 06:37:14 +09:00
@@ -1060,11 +1060,15 @@ func (h *BufPane) JumpToMatchingBrace() bool {
|
||||
r := h.Cursor.RuneUnder(h.Cursor.X)
|
||||
rl := h.Cursor.RuneUnder(h.Cursor.X - 1)
|
||||
if r == bp[0] || r == bp[1] || rl == bp[0] || rl == bp[1] {
|
||||
matchingBrace, left := h.Buf.FindMatchingBrace(bp, h.Cursor.Loc)
|
||||
if left {
|
||||
h.Cursor.GotoLoc(matchingBrace)
|
||||
matchingBrace, left, found := h.Buf.FindMatchingBrace(bp, h.Cursor.Loc)
|
||||
if found {
|
||||
if left {
|
||||
h.Cursor.GotoLoc(matchingBrace)
|
||||
} else {
|
||||
h.Cursor.GotoLoc(matchingBrace.Move(1, h.Buf))
|
||||
}
|
||||
} else {
|
||||
h.Cursor.GotoLoc(matchingBrace.Move(1, h.Buf))
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user