mirror of
https://github.com/Hopiu/micro.git
synced 2026-03-17 06:20:28 +00:00
Instead of passing a single brace pair to FindMatchingBrace(), make it
traverse all brace pairs in buffer.BracePairs on its own.
This has the following advantages:
1. Makes FindMatchingBrace() easier to use, in particular much easier
to use from Lua.
2. Lets FindMatchingBrace() ensure that we use just one matching brace -
the higher-priority one. This fixes the following issues:
([foo]bar)
^
when the cursor is on `[`:
- Both `[]` and `()` pairs are highlighted, whereas the expected
behavior is that only one pair is highlighted - the one that the
JumpToMatchingBrace action would jump to.
- JumpToMatchingBrace action incorrectly jumps to `)` instead of
`]` (which should take higher priority in this case).
In contrast, with `((foo)bar)` it works correctly.
|
||
|---|---|---|
| .. | ||
| autocomplete.go | ||
| backup.go | ||
| buffer.go | ||
| buffer_generated_test.go | ||
| buffer_test.go | ||
| cursor.go | ||
| eventhandler.go | ||
| line_array.go | ||
| line_array_test.go | ||
| loc.go | ||
| message.go | ||
| save.go | ||
| search.go | ||
| serialize.go | ||
| settings.go | ||
| stack.go | ||
| stack_test.go | ||