[vim/vim] Netrw Tree Style Listing moves the cursor to a different position. (PR #10001)

22 views
Skip to first unread message

James Cherti

unread,
Mar 23, 2022, 10:47:20 AM3/23/22
to vim/vim, Subscribed

This pull request fixes a bug in Netrw. Netrw Tree Style Listing moves the cursor to a different position when the user presses the Enter key to perform a directory listing; in a Netrw buffer that the user has reloaded with ':edit' or ':buffer'.

The "Perform Directory Listing" part of the function 's:NetrwBrowse()' should only call 'winrestview()' when the listing style of Netrw is not Tree Style Listing.

Steps to reproduce the bug

  1. Create the directory hierarchy:
$ mkdir -p ~/vim_bug/{dir1,dir2,dir3}
$ touch ~/vim_bug/{dir1,dir2,dir3}/{file1,file2,file3}
$ cd ~/vim_bug
  1. Execute Vim:
$ vim -u NONE -c 'set nocompatible' -c 'let g:netrw_liststyle = 3' -c "source /usr/share/vim/vim82/plugin/netrwPlugin.vim"
  1. Edit the current directory with Netrw:
    :edit .
  2. Move the cursor to "dir1" and press the Enter key.
  3. Move the cursor to "file1" and press the Enter key.
  4. Reopen netrw:
    :edit .
  5. Move the cursor to "dir3" and press the Enter key.

Netrw will move the cursor to a different position ("file1" under "dir1").


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/10001

Commit Summary

  • bf4a1da Fix: Netrw Tree Style Listing moves the cursor to a different position.

File Changes

(1 file)

Patch Links:


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10001@github.com>

codecov[bot]

unread,
Mar 23, 2022, 10:55:24 AM3/23/22
to vim/vim, Subscribed

Codecov Report

Merging #10001 (bf4a1da) into master (5c68617) will decrease coverage by 73.92%.
The diff coverage is n/a.

@@             Coverage Diff             @@

##           master   #10001       +/-   ##

===========================================

- Coverage   75.93%    2.01%   -73.93%     

===========================================

  Files         151      152        +1     

  Lines      146483   170210    +23727     

  Branches    38160    39362     +1202     

===========================================

- Hits       111235     3428   -107807     

- Misses      23518   166089   +142571     

+ Partials    11730      693    -11037     
Flag Coverage Δ
huge-gcc-unittests 2.01% <ø> (?)
linux 2.01% <ø> (?)
mingw-x64-HUGE ?
mingw-x64-HUGE-gui ?
windows ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/sha256.c 0.00% <0.00%> (-96.80%) ⬇️
src/crypt_zip.c 0.00% <0.00%> (-96.67%) ⬇️
src/evalbuffer.c 0.00% <0.00%> (-92.46%) ⬇️
src/vim9compile.c 0.00% <0.00%> (-91.96%) ⬇️
src/eval.c 0.10% <0.00%> (-91.33%) ⬇️
src/typval.c 2.56% <0.00%> (-90.95%) ⬇️
src/float.c 0.00% <0.00%> (-90.62%) ⬇️
src/vim9expr.c 0.00% <0.00%> (-90.45%) ⬇️
src/usercmd.c 0.00% <0.00%> (-89.69%) ⬇️
src/blob.c 0.00% <0.00%> (-89.53%) ⬇️
... and 154 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5c68617...bf4a1da. Read the comment docs.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10001/c1076465747@github.com>

K.Takata

unread,
Mar 23, 2022, 11:23:15 AM3/23/22
to vim/vim, Subscribed

Cc @cecamp


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10001/c1076485345@github.com>

James Cherti

unread,
May 17, 2022, 9:27:57 PM5/17/22
to vim/vim, Push

@jamescherti pushed 1 commit.

  • eca3524 Fix: Netrw Tree Style Listing moves the cursor to a different position.


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10001/push/9911005268@github.com>

James Cherti

unread,
Aug 15, 2022, 12:40:36 PM8/15/22
to vim/vim, Subscribed

I couldn't reproduce the issue anymore. I am going to close this pull request.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10001/c1215332299@github.com>

James Cherti

unread,
Aug 15, 2022, 12:40:38 PM8/15/22
to vim/vim, Subscribed

Closed #10001.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10001/issue_event/7189989808@github.com>

James Cherti

unread,
Aug 15, 2022, 12:42:29 PM8/15/22
to vim/vim, Subscribed

Reopened #10001.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10001/issue_event/7190000777@github.com>

James Cherti

unread,
Aug 15, 2022, 12:42:30 PM8/15/22
to vim/vim, Subscribed

I can still reproduce the issue. I am going to reopen the pull request.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/10001/c1215336784@github.com>

Reply all
Reply to author
Forward
0 new messages