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

With nosplitscroll the last focused window is scrolled when a new split is opened in the exit_cb function of a terminal popup #11160

Closed
bfrg opened this issue Sep 18, 2022 · 2 comments
Labels

Comments

@bfrg
Copy link
Contributor

bfrg commented Sep 18, 2022

Steps to reproduce

  1. Run vim --clean -S test.vim, with
vim9script
set splitbelow
set nosplitscroll
setline(1, range(100))
normal! G

const ptybuf: number = term_start(&shell, {
    hidden: true,
    exit_cb: (_, _) => {
        close
        help
    }
})

popup_create(ptybuf, {border: []})
  1. Close the shell by typing exit in the terminal popup (or alternatively, depending on the shell, press <C-d>).
  2. Result: The help window is opened and the popup is closed. But the previously focused window has been scrolled.

Expected behaviour

No scrolling when a window is split in a terminal callback function.

Version of Vim

9.0.500

Environment

Linux

Logs and stack traces

No response

@bfrg bfrg added the bug label Sep 18, 2022
@bfrg
Copy link
Contributor Author

bfrg commented Sep 18, 2022

cc @luukvbaal

luukvbaal added a commit to luukvbaal/vim that referenced this issue Sep 18, 2022
Problem:	Text scrolls for 'nosplitscroll' in terminal callback
because State is not updated yet.
Solution:	Treat terminal mode as normal mode in win_fix_cursor()
(Fix vim#11160).
@bfrg
Copy link
Contributor Author

bfrg commented Sep 19, 2022

Fixed by faf1d41.

@bfrg bfrg closed this as completed Sep 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant