screenstring()
doesn't recognize floating windows in child Neovim process
#22018
Labels
bug-regression
wrong behavior that was introduced in a previous commit (please bisect)
float
floating windows
ui
Milestone
Describe the bug
The
screenstring()
executed inside child Neovim process through RPC doesn't recognize floating windows.This seems to have the same root cause as #21886. When applying the workaround from that issue (spawn another process to attach a UI), it works locally, but probably has the same problems as in that issue.
This might also be related to #19020, which actually made
screenstring()
recognize floating windows.Steps to reproduce
Create 'init-child-screenstring_floating.lua' with the following content:
init-child-screenstring_floating.lua
It is basically a creation-connection to full child process (following advice from Can't receive an answer from RPC request to Neovim created as child process #21630) and then a couple helper wrappers to get and set information in child process through RPC requests.
Assuming
nvim_nightly_g825
is the executable for latest nightly, runnvim_nightly_g825 -u init-child-screenstring_floating.lua
.:lua child = new_child('nvim_nightly_g825')
. This should create and connect to child process running latest nightly.:lua child.setup_text_with_float()
. This should add normal textaaaa
covered bybb
text in floating window. In total,bb a
should be a visible text.Execute
:lua print(child.screenstring(1, 1))
. It printsa
, but should printb
.Expected behavior
Always prints actually visible screen string.
There are three notes here:
It works in Neovim 0.8.2 (with
new_child('nvim')
, assumingnvim
is Neovim 0.8.2).It works if applied the workaround from
screenstring()
doesn't work for Command line in child Neovim process #21886. So adding these lines beforelocal channel = ...
makes it work locally:It works if executed not in child process, but in "normal" one:
nvim_nightly_g825 -u init-screenstring_floating.lua
.:echo screenstring(1, 1)
. It indeed printsb
.Neovim version (nvim -v)
NVIM v0.9.0-dev-825+g843c9025a
Vim (not Nvim) behaves the same?
No (doesn't have this functionality)
Operating system/version
EndeavourOS Linux x86_64 (6.1.7-arch1-1)
Terminal name/version
st-0.9
$TERM environment variable
st-256color
Installation
appimage
The text was updated successfully, but these errors were encountered: