]> git.lizzy.rs Git - micro.git/commitdiff
fix the missing break in JumpToMatchingBrace (#1960)
authorworldmaker <worldmaker18349276@gmail.com>
Sun, 27 Dec 2020 23:38:16 +0000 (07:38 +0800)
committerGitHub <noreply@github.com>
Sun, 27 Dec 2020 23:38:16 +0000 (18:38 -0500)
In JumpToMatchingBrace, the loop should stop immediately after finding the matching bracket.
It causes multiple jumps in certain situations:
`(I  [  ]{  }) => (  I[  ]{  })`

internal/action/actions.go

index b69ac2d0dc0ea6b25942f92444c7fd6311b80c1a..ee9c78aaee081077f78f795ab2b6de060f3ca183 100644 (file)
@@ -1195,6 +1195,7 @@ func (h *BufPane) JumpToMatchingBrace() bool {
                                } else {
                                        h.Cursor.GotoLoc(matchingBrace.Move(1, h.Buf))
                                }
+                               break
                        } else {
                                return false
                        }