mcchrish / nnn.vim

File manager for vim/neovim powered by n³
BSD 2-Clause "Simplified" License
645 stars 25 forks source link

Popup Window does not scroll #62

Closed ldelossa closed 3 years ago

ldelossa commented 4 years ago

Describe the bug

nnn-vim in popup-mode does not scroll the contents of the popup window

To Reproduce

" nnn configurations
let g:nnn#action = {
      \ '<C-h>': 'split',
      \ '<C-v>': 'vsplit' }
let $DISABLE_FILE_OPEN_ON_NAV=1
let $NNN_RESTRICT_NAV_OPEN=1
let g:nnn#layout = { 'window': { 'width': 0.9, 'height': 0.6, 'highlight': 'Debug' } }

Open a popup nnn with contents large enough to force the view to scroll, then try to scroll

Expected behavior

The popup window scrolls with the contents

Environment:

pddevins commented 4 years ago

I am also experiencing this bug: OS: macOS 10.15.5 Terminal: iTerm2 Shell: zsh 5.7.1 Vim version: 8.2.1100 Plugin manager: vim-plug Plugin version: master Nnn version: 3.2

TomBaxter commented 4 years ago

I was unable to reproduce this issue with the given nnn.vim configuration. OS: Ubuntu 20.04 Terminal: gnome-terminal Shell: tried with both bash and zsh Vim version: Neovim 0.4.3 Plugin manager: vim-plug Plugin version: master Nnn version: 3.0

katmfoo commented 4 years ago

I am also experiencing this bug

OS: Arch Terminal: Termite Shell: bash 5.0.18 Vim version: 8.2.1704 Plugin manager: vim-plug Plugin version: master Nnn version: 3.4

jarun commented 4 years ago

@mcchrish can you take a look? Otherwise, someone has to pitch in.

mcchrish commented 4 years ago

I'm not able to reproduce the bug. Using vim or neovim, nnn version 3.4. I opened an nnn popup window to view a directory with lots of subdirs and files, still able to scroll through them.

Does it only happen with popup/floating windows?

katmfoo commented 4 years ago

@mcchrish For me, yes it only happens with popup/floating windows. Scrolling through a directory with more files/folders than there are lines in the popup window cause a bunch of weird things to happen.

Here is a recording of what it looks like to me: https://asciinema.org/a/360436

This is just me repeatedly hitting j to move down through the files on the root of my system. As you can see, when it starts scrolling, things get weird.

My vimrc: https://github.com/pricheal/dotfiles/blob/master/.vimrc and my vim config for nnn.vim: https://github.com/pricheal/dotfiles/blob/master/.vim/plugin/nnn.vim

Edit: here is scrolling working normally without floating window: https://asciinema.org/a/360438

mcchrish commented 4 years ago

I'm now able reproduce the bug on vim + bash. Bash:

GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin19)
Copyright (C) 2007 Free Software Foundation, Inc.

Vim:

VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Sep 16 2020 23:47:44)
macOS version
Included patches: 1-1700

Minimal vimrc:

set nocompatible
set hidden

let g:nnn#command = 'nnn -C'
let g:nnn#layout = { 'window': { 'width': 0.9, 'height': 0.6, 'highlight': 'Debug' } }
set shell=/bin/bash

call plug#begin('~/.local/share/nvim/vendor')
Plug '~/vimming/nnn.vim'
call plug#end()

I'm not sure if there is anything else this plugin can do to fix the bug. It could be a problem coming from either Vim terminal, bash or nnn itself. (Also able to reproduce bug in floatterm nnn wrapper).

Work around for now is to change the &shell to something like zsh or move to neovim. I made an option to configure the shell which this plugin will use with the setting g:nnn#shell. e.g let g:nnn#shell = '/bin/zsh'. See :h g:nnn#shell. https://github.com/mcchrish/nnn.vim/commit/02c625f36334ffc6d8940d83f3633fdf39f1b613

ldelossa commented 4 years ago

I honestly havent experienced this issue since moved to a new laptop and reinstalled linux. So i cant help troubleshoot further.

beckeru commented 3 years ago

For me it works if airline is not loaded.

katmfoo commented 3 years ago

@mcchrish I am still experiencing this issue and haven't been able to figure out any fix. What specifically would I need to put in my vim config for the work around you listed above (with the &shell option)?

beckeru commented 3 years ago

Maybe the issue is related to 256-colors when setting NNN_COLORS in 256 color format see

export NNN_COLORS='#0a0a0a0a'

it also works for me (even with airline)

katmfoo commented 3 years ago

Setting my shell to zsh doesn't fix the issue for me, neither does changing any color settings with the -C option or the NNN_COLORS environment variable.

mcchrish commented 3 years ago

Similar issue: https://github.com/voldikss/vim-floaterm/issues/171

jarun commented 3 years ago

Work around for now is to change the &shell to something like zsh

I am on zsh and still see the same issue. Tried let g:nnn#shell = '/usr/bin/zsh' too.

jarun commented 3 years ago

The original issue submitter mentioned he is not seeing this anymore. I am also not seeing any glitches after moving to nvim.

For others who see this on vim - it's probably broken in vim. If you are on vim, consider moving to neovim.

We will not waste our time on vim-only issues going forward. Being a legacy software, it has a huge community for namesake, but not a single member buzzes when it comes to actual contribution.