Commit Graph

18 Commits (518297780bc451274e1269950f3fe53dea3deb99)

Author SHA1 Message Date
Blaž Hrastnik c2c1280f02
Resolve a bunch of upcoming clippy lints 2 years ago
Ryan Russell ae12c58f0f
Improve Readability (#2639) 2 years ago
Gokul Soumya 22ae1b92a6 Fix tests for surround primitives 2 years ago
Gokul Soumya 76175dbd6d Support m in surround delete and replace 2 years ago
Gokul Soumya de15d70171 Add `m` textobject to select closest surround pair 2 years ago
Gokul Soumya c15996aff5
Show surround delete and replace errors in editor (#1709)
* Refactor surround commands to use early returns

* Show surround delete and replace errors in editor
2 years ago
Omnikar f064894e57
Fix Clippy lints in tests (#1563)
Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
2 years ago
Gokul Soumya dc53e65b9e
Fix surround cursor position calculation (#1183)
Fixes #1077. This was caused by the assumption that a block
cursor is represented as zero width internally and simply
rendered to be a single width selection, where as in reality
a block cursor is an actual single width selection in form and
function.

Behavioural changes:

1. Surround selection no longer works when cursor is _on_ a
    surround character that has matching pairs (like `'`
    or `"`). This was the intended behaviour from the start
    but worked till now because of the cursor position
    calculation mismatch.
3 years ago
Nathan Vegdahl c9cbc344fc Fix buggy surround behavior from #376.
Fixes #543.
3 years ago
Nathan Vegdahl f96b8b769b Switch to a cleaner range-head moving abstraction.
Also fix a bunch of bugs related to it.
3 years ago
Nathan Vegdahl b4c59b444c Update surround commands to work with gap indexing. 3 years ago
Ivan Tham 6ccfa229ed Fix typo on comment in surround 3 years ago
Gokul Soumya 351c1e7e55 Fix surround bug when cursor on same pair
For example when the cursor is _on_ the `'` in `'word'`, the cursor
wouldn't move because the search for a matching pair started _from_ the
position of the cursor and simply found itself.
3 years ago
Gokul Soumya 394629ab73 Skip enclosed pairs in surround
Surround operations previously ignored other pairs that are
enclosed within which should be skipped. For example if the
cursor is on the `,` in `{{a},{b}}`, doing `md{` previously
would delete the `{` on the left of `a` and `}` on the right
of `b` instead of the outermost braces. This commit corrects
this behavior.
3 years ago
Gokul Soumya 892c80771a Correctly identify pairs when cursor on pair 3 years ago
Gokul Soumya 86271bac18 Refactor and add tests for surround 3 years ago
Gokul Soumya 4754b2e5ae Add more surround pair characters 3 years ago
Gokul Soumya 13648d28b9 Add surround keybinds 3 years ago