Skip to content

Flickering in popups windows - Introduced by patch 9.2.0016 #19510

@JavierJF

Description

@JavierJF

Steps to reproduce

  1. Copy the following script in a buffer.
" scroll_popup.vim
" Continuously scrolling popup with multi-line content

let s:text = []
for i in range(1, 50)
	call add(s:text, printf("This is scrolling line %02d — Vim popup demo", i))
endfor

let s:firstline = 1
let s:popup_id = -1

function! s:scroll_popup(timer) abort
	let s:firstline += 1

	" Wrap when reaching the end
	if s:firstline > len(s:text)
		let s:firstline = 1
	endif

	call popup_setoptions(s:popup_id, {'firstline': s:firstline})
endfunction

function! StartScrollingPopup() abort
	let s:popup_id = popup_create(s:text, {
		\ 'title': 'Scrolling Popup',
		\ 'pos': 'center',
		\ 'minwidth': 60,
		\ 'minheight': 10,
		\ 'maxheight': 10,
		\ 'border': [],
		\ 'scrollbar': 1,
		\ 'opacity': 100,
	\ })

	" Scroll every 500 ms
	call timer_start(1000, function('s:scroll_popup'), {'repeat': -1})
endfunction

call StartScrollingPopup()
  1. Source the buffer. If there is background text overlapping with the popup, flickering will start to take place in the areas where background text intersect with popup text.

The issue has been bisected to patch 9.2.0016, with commit 6c20307 and subsequent commit 95e8faa. This is reproducible in at least alacritty and kitty terminal emulators.

Expected behaviour

There should be no flickering when the popup is scrolled or refreshed.

Version of Vim

Bisected to patch 9.2.0016

Environment

Operating system: Arch Linux
Terminal: Alacritty / Kitty
$TERM: xterm-256color
Shell: zsh / bash

Logs and stack traces

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