Skip to content
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 ai is based on start of selection instead of cursor position #10

Open
bew opened this issue Nov 16, 2021 · 1 comment
Open

Visual ai is based on start of selection instead of cursor position #10

bew opened this issue Nov 16, 2021 · 1 comment

Comments

@bew
Copy link

bew commented Nov 16, 2021

With the following code:

def foo():
    pass

@decorator               # visual select this line
def bar():               # and this line
    print("some code")   # and this line, cursor should be left on this line
    print("some other code")

    print("here we are doing real things!")
    print("some more other code...")

def other_foo():
    pass

So we're in visual mode, the cursor is on an indented line inside function bar.

Now if I do ai I'd expect to select the rest (or maybe only the inside?) of the function bar, instead it select the whole file..

It looks like it considers the start of the visual search as the indentation to use, but I think it should take the current cursor position for this, no?

NOTE: when we're in normal mode, and the cursor is on a print in function bar, vai does select only the inside of the function, so that works.

@kana
Copy link
Owner

kana commented Nov 17, 2021

Thank you for the feedback. I've never used ai / ii after selecting some area, so that I didn't notice that problem.

Your suggestion sounds reasonable. I'll consider changing ai / ii to extend the current selection based on the cursor line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants