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

Netrw randomly opens the wrong file #13215

Open
dbatten5 opened this issue Nov 3, 2020 · 3 comments
Open

Netrw randomly opens the wrong file #13215

dbatten5 opened this issue Nov 3, 2020 · 3 comments
Labels
bug-vim wrong behavior inherited from vim netrw fuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu
Milestone

Comments

@dbatten5
Copy link

dbatten5 commented Nov 3, 2020

  • nvim --version:
NVIM v0.4.4
Build type: Release
LuaJIT 2.0.5
Compilation: /usr/bin/clang -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNDEBUG -DMIN_LOG_LEVEL=3 -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 -I/tmp/neovim-20200808-89283-1us0ytm/neovim-0.4.4/build/config -I/tmp/neovim-20200808-89283-1us0ytm/neovim-0.4.4/src -I/usr/local/include -I/tmp/neovim-20200808-89283-1us0ytm/neovim-0.4.4/deps-build/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include -I/usr/local/opt/gettext/include -I/tmp/neovim-20200808-89283-1us0ytm/neovim-0.4.4/build/src/nvim/auto -I/tmp/neovim-20200808-89283-1us0ytm/neovim-0.4.4/build/include
Compiled by brew@Catalina

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/local/Cellar/neovim/0.4.4/share/nvim"

Run :checkhealth for more info
  • vim -u DEFAULTS (version: ) behaves differently? No - same issue.
  • Operating system/version: macOS 10.15.7
  • Terminal name/version: iTerm2 Build 3.3.12
  • $TERM: xterm-256color

Steps to reproduce using nvim -u NORC

nvim -u NORC
# Alternative for shell-related problems:
# env -i TERM=ansi-256color "$(which nvim)"
It's difficult to reproduce as it seems to happen randomly or at least with a pattern that I haven't picked up on, but the following steps are taken to reproduce.
- Open netrw
- Navigate to a target file or directory with eg. 12j or using the / search tool
- Press <cr>

I expect the target file or directory to be opened, instead sometimes the file or directory at the bottom of the netrw opened is opened.

I typically open netrw with :Explore which I've mapped to and open files / expand directories by pressing enter with my cursor on the target. About 50% of the time however, pressing enter will instead open whatever file is at the bottom of the netrw window. The only mapping I have for while a netrw buffer is active is:

n  <CR>         @<Plug>NetrwLocalBrowseCheck
@dbatten5 dbatten5 added the bug issues reporting wrong behavior label Nov 3, 2020
@janlazo janlazo added the netrw fuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu label Feb 16, 2021
@TamaMcGlinn
Copy link

I also have this issue. I would estimate the occurence to be around 1%, and also haven't spotted any patterns - but once the bug occurs, I have noted that it becomes reproducible while the buffer remains open, because no matter how often I press - to go back to the parent and select that same directory, it will keep opening the bottom directory instead of the selected one, until I reopen netRW.

@matu3ba
Copy link

matu3ba commented Sep 29, 2021

  1. Is this reproducible inside vim as well?
  2. Did you give git bisect a shot on the netrw code (after finishing 1)?
  3. Tools for debugging vimscript are listed here: https://vi.stackexchange.com/a/25863
  4. It could be also something like random memory glitches or so in the vimscript runtime, but from not crashing and result staying consistent I would assume this not to be the case.

Please report any finding on trying to nail the source for this down.

@justinmk
Copy link
Member

justinmk commented Oct 3, 2021

vim -u DEFAULTS (version: ) behaves differently? No - same issue.

This is why we have the netrw label :)

@justinmk justinmk added the bug-vim wrong behavior inherited from vim label Oct 3, 2021
@justinmk justinmk added this to the unplanned milestone Oct 3, 2021
@dundargoc dundargoc removed the bug issues reporting wrong behavior label Dec 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-vim wrong behavior inherited from vim netrw fuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu
Projects
None yet
Development

No branches or pull requests

6 participants