Skip to content

WinScrolled is activated only after first resize due to effect of winwidth/winheight #11576

@echasnovski

Description

@echasnovski

Steps to reproduce

  1. Create init file ('init-winscrolled-winwidth.vim' in this example') with the following contents:
let g:winscrolled_events = []
au WinScrolled * let g:winscrolled_events = g:winscrolled_events + [expand('<amatch>')]
  1. Run vim -u init-winscrolled-winwidth.vim.
  2. Create new window with vertical split (<C-w>v).
  3. Switch back and forth with <C-w>l<C-w>h. This consumes WinScrolled events resulting from initial vertical split.
  4. :echo g:winscrolled_events. It should show ['1001', '1000'].
  5. :set winwidth=10000. Current window should occupy maximum width, i.e. it was resized.
  6. Again switch windows back and forth. Each switch leads to resizing of current window to maximum width.
  7. :echo g:winscrolled_events. It should show ['1001', '1000', '1001', '1000'].
  8. And again switch back and forth. Each switch still resizes window.
  9. :echo g:winscrolled_events. It now shows the same history as after previous echo, but it should have added two more window numbers.

Note: same applies to winheight and horizontal split.

Expected behaviour

WinScrolled event is activated after any window resize, including resulting from winwidth and winheight.

Version of Vim

9.0.813

Environment

OS: EndeavourOS Linux x86_64, 6.0.8-arch1-1
Terminal: st
$TERM: st-256color
Shell: zsh 5.9

Logs and stack traces

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions