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

call win_execute(id, ':call cursor(100, 1)') do not redraw the windows 1002 #5022

Closed
wsdjeg opened this issue Oct 6, 2019 · 7 comments

Comments

@wsdjeg
Copy link

commented Oct 6, 2019

the new feature win_execute do not redraw the move the screen line.

To Reproduce
Detailed steps to reproduce the behavior:

  1. Run vim --clean (or gvim --clean, etc.)
  2. Edit filename, the filename has 800 lines
  3. run :20 to move to line 20
  4. :split and let id = win_getid()
  5. run call win_execute(id, ':call cursor(100, 1)')

but the window 2 screen do not changed, the cursor line of that creen should be able to see.

@wsdjeg wsdjeg changed the title call win_execute(1002, ':call cursor(100, 1)') do not redraw the windows 1002 call win_execute(id, ':call cursor(100, 1)') do not redraw the windows 1002 Oct 6, 2019
@brammool

This comment has been minimized.

Copy link
Contributor

commented Oct 8, 2019

I cannot reproduce, the cursor jumps to line 100 as expected.
Perhaps a step is missing? Before step 5 did you do ":windcmd w" ?
Then the display isn't updated, because scrolling to show the cursor only happens for the current window, that is intentional.
You can use call win_execute(id, 'call cursor(100, 1)|normal zz')
I notice the ruler isn't updated then..

@brammool brammool closed this in 345f28d Oct 8, 2019
@wsdjeg

This comment has been minimized.

Copy link
Author

commented Oct 11, 2019

what I need is to scroll a window without to jumto that window, this can be done in neovim's python mode, we can use buffer.col and buffer,line to set the cursor and the creen will be scrolled automatically.

@chrisbra

This comment has been minimized.

Copy link
Member

commented Oct 11, 2019

so use win_execute() as suggested.

@wsdjeg

This comment has been minimized.

Copy link
Author

commented Oct 11, 2019

@chrisbra thanks, I am writing compatible plugin for old vim, so how can I do this if my vim do not have this function?

@wsdjeg

This comment has been minimized.

Copy link
Author

commented Oct 11, 2019

@chrisbra I mean, if in lua code, I use:

    local w = vim.window(winindex)
    w.line = pos[0]
    w.col = pos[1]

then, how can I scroll that windows.

@chrisbra

This comment has been minimized.

Copy link
Member

commented Oct 11, 2019

Yeah, you need 868b7b6 (8.1.1418) for win_execute(). If your vim is older, then switch to the window and scroll and switch back. I don't understand how lua helps here, what if your Vim does not have a lua interface compiled in?

@wsdjeg

This comment has been minimized.

Copy link
Author

commented Oct 11, 2019

@chrisbra Thanks, in neovim, when I use lua to change the cursor, the window scrolled automatically, so I just think it should works in vim7 too, but sad, it can not. thanks again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.