Handling inclusive_op and exclusivity(till) with bi-directional search? #92
Unanswered
austinliuigi
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've been trying out bi-directional search and I find it really comfortable, but I'm not sure how to better tweak my config it so that it's the most intuitive for me in visual/operator-pending mode:
s
-> Inclusive regardless of which direction I jumpx
-> Exclusive regardless of which direction I jumpHowever, the only way that I've found to achieve this behavior is quite hacky and I'm wondering if there's a better way. This is my current configuration:
Insights
1. inclusive_op
The reason the separate operator-pending mappings are necessary is because
inclusive_op
behaves incorrectly(?)Example ('|' is cursor, '1' is first label, '2' is second label)
abcdefg|abcdefg
Expected behavior:
inclusive_op = true
dsde1
->abcabcdefg
dsde2
->abcdefgefg
inclusive_op = false
dsde1
->abcdabcdefg
dsde2
->abcdefgdefg
Actual behavior:
inclusive_op = true
dsde1
->abcdabcdefg
×dsde2
->abcdefgefg
✓inclusive_op = false
dsde1
->abcabcdefg
×dsde2
->abcdefgefg
✓When jumping backwards, it seems like inclusive_op behaves opposite as expected.
In hindsight, this is the main concern for this discussion thread.
2. Determining jump direction
For my visual mode
x
mapping, I do some logic to determine whether I jumped backwards or forwards using vim'sgetpos()
. Is there a better way to do this using leap's api?Beta Was this translation helpful? Give feedback.
All reactions