-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Visual selection and passed range conflated after 9d43 #137
Comments
Hi, thanks for the prompt review! I couldn't recall the issue with the last visual selection, therefore I tested all use cases I could think of and hope this is not an issue anymore. Could you remind me how to reproduce it in the plugin? |
So in a buffer reading
select the first sentence by
|
In the commit above, there was an intended breaking change: plugin does not include current line into the prompt (unless it is visually selected). Is this still an issue then? |
If the intent was to break single line ranges, then it was as intended, but from a user perspective something that works is more desirable. Regarding multiline selections, have a buffer reading
and hit In fact, this hints at another bug that |
The motivation is that hitting
I cannot reproduce this, it works as expected in my environment. Could you explain more or share a gif? |
Since two bugs are at work here, maybe the following two-line example makes this clearer: In a buffer reading
hit Then only
is handled |
That's the first time I try recording a Gif, maybe https://imgur.com/mTyqhhG helps? |
I see, now I remember this weird issue. What do you think of using |
Sounds great as it seems to work; as it's been around since version 5 I wonder why this approach has not been used yet. Maybe nobody thought of it since Vim's vast |
The funny thing is that I can reproduce all buggy scenarios above with the version before the commit, e.g. ea83fdc With |
In this 3122b84 I have re-enabled single line ranges. I still wonder what was the reason |
I have yet to check but |
You're right. These two tests also fail before the penultimate commit. They work if the cursor moves in-between the two mode changes, though, similar to the issue that was closed.
instead of
then they pass. Not moving at all between changing modes is rather rare, that's why it went undiscovered for a while |
After the simplification commit 9d43ef6#diff-c5343a5d13850471f849776609ce57fc060df53e28763bb19f8c407e81854970R191 (in response to #112 (comment) ?) users could be surprised if the lines covered by the last visual selection coincide with those passed to it as it effectively conflates these two situations.
Is this what the
truty
comment refers to?One workaround is outlined at artificial range parameter and I guess this is what
g:vim_ai_is_selection_pending
was introduced if I can remember somewhat correctly.While removing it simplifies code and improves developer experience, user experience suffers in this sense.
The text was updated successfully, but these errors were encountered: