feat: goto_bracket goes to the pair bracket under cursor
Uses simple matching nesting, as a complement to tree-sitter approach. Flow mode shorcut ctrl+shit+\ ala Code
This commit is contained in:
parent
57547b80ff
commit
56ea0138a5
3 changed files with 78 additions and 0 deletions
|
|
@ -50,6 +50,15 @@ pub const char_pairs = [_]struct { []const u8, []const u8 }{
|
|||
.{ "«", "»" },
|
||||
};
|
||||
|
||||
pub const open_close_pairs = [_]struct { []const u8, []const u8 }{
|
||||
.{ "(", ")" },
|
||||
.{ "[", "]" },
|
||||
.{ "{", "}" },
|
||||
.{ "‘", "’" },
|
||||
.{ "“", "”" },
|
||||
.{ "«", "»" },
|
||||
};
|
||||
|
||||
fn raw_byte_to_utf8(cp: u8, buf: []u8) ![]const u8 {
|
||||
var utf16le: [1]u16 = undefined;
|
||||
const utf16le_as_bytes = std.mem.sliceAsBytes(utf16le[0..]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue