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

Works incorrectly when a line is too long and is split into multiple lines #40

Open
ouuan opened this issue Feb 24, 2022 · 5 comments
Open
Labels
help wanted Extra attention is needed

Comments

@ouuan
Copy link

ouuan commented Feb 24, 2022

Describe the bug

When a line is too long and is split into multiple lines, the scrollbar behaves incorrectly.

To Reproduce

  1. Fill the screen with long lines that don't fit into a single line.
  2. The scrollbar appears only when there are enough text lines, instead of enough visual lines.
  3. The scrollbar character only appears at the first visual line of each text line and seems broken. Some lines even don't have the scrollbar character.

Expected behavior

  1. The scrollbar appears when the screen is full, instead of when there are enough text lines.
  2. The scrollbar appearance should be continuous.

Screenshots

broken scrollbar

Version Info (please complete the following information):

  • nvim --version
NVIM v0.7.0-dev+1132-g15004473b5
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/cc -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -DNVIM_TS_HAS_SET_MATCH_LIMIT -DNVIM_TS_HAS_SET_ALLOCATOR -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/build/neovim-git/src/build/config -I/build/neovim-git/src/neovim-git/src -I/usr/include -I/build/neovim-git/src/build/src/nvim/auto -I/build/neovim-git/src/build/include
Compiled by builduser

Features: +acl +iconv +tui
@petertriho
Copy link
Owner

Yep, this is a bug when vim.opt.wrap = true.

I'm unsure of a fix for this at the moment. I believe this can fix it but I haven't had a chance to look at it yet.

@petertriho petertriho added the help wanted Extra attention is needed label Feb 25, 2022
@thaiducdung255
Copy link

Yep, this is a bug when vim.opt.wrap = true.

I'm unsure of a fix for this at the moment. I believe this can fix it but I haven't had a chance to look at it yet.

This is also occour when i set wrap to false
image

@adrian5
Copy link

adrian5 commented Oct 4, 2022

Maybe something can be gleaned from how nvim-scrollview accomplishes this?

@yehuohan
Copy link

Yep, this is a bug when vim.opt.wrap = true.
I'm unsure of a fix for this at the moment. I believe this can fix it but I haven't had a chance to look at it yet.

This is also occour when i set wrap to false image

I got the same case with nowrap. And I found set the argument col=0 to the function nvim_buf_set_extmark of https://github.com/petertriho/nvim-scrollbar/blob/main/lua/scrollbar/init.lua#L161 and https://github.com/petertriho/nvim-scrollbar/blob/main/lua/scrollbar/init.lua#L177 can resolve this case. (But still not works for wrap. And not works with multi-bytes character where scrollbar mark is going to place)

petertriho added a commit that referenced this issue Oct 19, 2022
@edshamis
Copy link

edshamis commented Apr 8, 2023

Still break scrollbar for line with wrap. Would be nice to fix it.
Thanks for the great plugin btw!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

6 participants