micro/internal/buffer
Dmytro Maluka 9eb8782ff2
Rework FindMatchingBrace() interface and implementation (#3319)
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.
2024-06-05 00:56:19 +02:00
..
autocomplete.go Replaced IsNonAlphaNumeric() with IsNonWordChar() 2024-05-20 23:23:33 +02:00
backup.go Allow aborting while opening a file with backup 2021-08-02 21:05:22 -04:00
buffer.go Rework FindMatchingBrace() interface and implementation (#3319) 2024-06-05 00:56:19 +02:00
buffer_generated_test.go Merge branch 'buffer-benchmarks' of https://github.com/p-e-w/micro into p-e-w-buffer-benchmarks 2020-05-20 15:28:36 -04:00
buffer_test.go buffer: Uncomment InitRuntimeFiles(false) in the buffer_test.go 2024-04-05 14:24:59 +02:00
cursor.go Fixed trailing line spaces being ignored by word- or subword-jumps (#3321) 2024-06-04 21:10:09 +02:00
eventhandler.go hltrailingws: simpler and better undo/redo handling 2024-03-14 03:18:11 +01:00
line_array.go buffer: Rename LineBytes parameter to "lineN" to fit to the rest 2024-04-05 14:24:39 +02:00
line_array_test.go Improve unicode line array test 2020-05-20 19:53:54 -04:00
loc.go Use CharacterCount over RuneCount 2020-05-20 16:47:08 -04:00
message.go Warn for readonly instead of setting option 2021-05-19 14:58:00 -04:00
save.go option: Don't apply rmtrailingws in case of timed autosave (#2850) 2024-03-15 18:46:51 +01:00
search.go command: Fix replace to be able to insert '$' (#2954) 2024-03-17 21:37:16 +01:00
serialize.go Fix quality issues (#1856) 2020-09-16 00:08:01 -04:00
settings.go Add param to InitRuntimeFiles() to init built-in files only 2024-04-03 03:41:06 +02:00
stack.go Change project layout and use go.mod 2019-12-25 17:05:10 -05:00
stack_test.go Change project layout and use go.mod 2019-12-25 17:05:10 -05:00