dstein64 / nvim-scrollview

A Neovim plugin that displays interactive vertical scrollbars and signs.
MIT License
516 stars 9 forks source link

Scrollview hides text at the end of a line #132

Open lostl1ght opened 5 days ago

lostl1ght commented 5 days ago

Hello!

I'm not sure if it is a bug or not but the scrollbar hides text at the end of a line. Is there any way to wrap text before scrollbar?

Steps to reproduce

Minimal config ```lua local root = '/tmp/nvim' for _, name in ipairs({ 'config', 'data', 'state', 'cache' }) do vim.env[('XDG_%s_HOME'):format(name:upper())] = root .. '/' .. name end local lazy_path = root .. '/plugins/lazy.nvim' if not vim.uv.fs_stat(lazy_path) then vim.api.nvim_cmd({ cmd = '!', args = { 'git', 'clone', '--filter=blob:none', '--single-branch', 'https://github.com/folke/lazy.nvim.git', lazy_path, }, }, {}) end vim.opt.runtimepath:prepend(lazy_path) local plugins = { { 'folke/lazy.nvim' }, { 'rebelot/kanagawa.nvim' }, -- plugins { 'dstein64/nvim-scrollview', dependencies = { 'lewis6991/gitsigns.nvim', config = true }, config = function() vim.cmd([[let g:scrollview_mode = 'proper']]) require('scrollview.contrib.gitsigns').setup() end, }, } vim.g.mapleader = ' ' require('lazy').setup(plugins, { root = root .. '/plugins', }) vim.opt.termguicolors = true vim.cmd({ cmd = 'colorscheme', args = { 'kanagawa' } }) ```

Below the letters ex are hidden: image

dstein64 commented 4 days ago

Hi @lostl1ght. I don't know of a Neovim option for specifying where text should wrap when wrap is set.

The plugin has options for controlling the transparency of its windows. If you're using termguicolors or a GUI, the option is scrollview_winblend_gui, otherwise the option is scrollview_winblend. They can be set between 0 and 100 (0 for full opacity and 100 for full transparency).

However, transparency only works if there is no text (on scrollbars and/or signs). By default, the scrollbar has no text (this can be changed with the scrollview_character option). By default, the built-in signs all include text. To make them transparent, they'd have to be configured to have no symbol, and a highlight that has a background color (the foreground highlight would only be applied to text).

Here's an example showing how the scrollbar and search signs could be made partially transparent.

let g:scrollview_winblend = 80
let g:scrollview_winblend_gui = 80
highlight ScrollViewSearch ctermbg=159 guibg=LightCyan
let g:scrollview_search_symbol = ''

But removing the text from signs makes them less useful. They'd have to be differentiated based on their color only.

lostl1ght commented 2 days ago

So, it appears that there's no option to wrap before EOL. And, unfortunately, the suggested plugin setting are not ideal.

Other option is to toggle the scrollbar on InsertEnter & InsertLeave, so that it does not obstruct text in insert mode, but, again, it's not ideal.

You can close as not planned if you'd like.