Bug 652610 - "vim .." does not show files properly
Summary: "vim .." does not show files properly
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: vim
Version: 6.0
Hardware: Unspecified
OS: Unspecified
low
medium
Target Milestone: rc
: ---
Assignee: Karsten Hopp
QA Contact: Petr Šplíchal
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-11-12 10:34 UTC by Petr Šplíchal
Modified: 2021-09-09 13:16 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 825307 1031685 (view as bug list)
Environment:
Last Closed: 2012-04-05 08:24:08 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2012:0454 0 normal SHIPPED_LIVE vim bug fix update 2012-04-05 12:22:05 UTC

Description Petr Šplíchal 2010-11-12 10:34:13 UTC
Description of problem:

Opening (directly) a parent directory in vim results in an almost
empty list of files in the directory. Only a few file name chars
are scattered around the screen. See the example below.

Version-Release number of selected component (if applicable):
vim-enhanced-7.2.411-1.4.el6.x86_64

Steps to Reproduce:
cd /tmp
vim ..
  
Actual results:
" ============================================================================
" Netrw Directory Listing                                        (netrw v134)
"   /tmp/..
"   Sorted by      name
"   Sort sequence: [\/]$,\.h$,\.c$,\.cpp$,*,\.o$,\.obj$,\.info$
"   Quick Help: <F1>:help  -:go up dir  D:delete  R:rename  s:sort-by  x:exec
" ============================================================================
ound/
x/





















erc
sck



Expected results:
" ============================================================================
" Netrw Directory Listing                                        (netrw v134)
"   /
"   Sorted by      name
"   Sort sequence: [\/]$,\.h$,\.c$,\.cpp$,*,\.o$,\.obj$,\.info$
"   Quick Help: <F1>:help  -:go up dir  D:delete  R:rename  s:sort-by  x:exec
" ============================================================================
./
bin/
boot/
cgroup/
dev/
etc/
home/
lib/
lib64/
lost+found/
media/
mnt/
opt/
proc/
root/
sbin/
selinux/
srv/
sys/
tmp/
usr/
var/
.autofsck
profilerc

Comment 1 RHEL Program Management 2011-07-06 00:24:45 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unfortunately unable to
address this request at this time. Red Hat invites you to
ask your support representative to propose this request, if
appropriate and relevant, in the next release of Red Hat
Enterprise Linux. If you would like it considered as an
exception in the current release, please ask your support
representative.

Comment 2 Karsten Hopp 2012-02-15 15:17:48 UTC
--- a/netrw.vim
+++ b/netrw.vim
@@ -6733,7 +6733,14 @@ fun! s:LocalListing()
 
   " get the list of files contained in the current directory
   let dirname    = escape(b:netrw_curdir,g:netrw_glob_escape)
-  let dirnamelen = strlen(b:netrw_curdir)
+  if dirname =~ '\.\.'
+   let dirname = substitute(dirname,'[^/]*/\.\.','','g')
+  endif
+  if dirname == ''
+   let dirname = '/'
+  endif
+  let dirnamelen = strlen(dirname)
+
   let filelist   = glob(s:ComposePath(dirname,"*"))
 "  call Decho("glob(dirname<".dirname."/*>)=".filelist)
   if filelist != ""
@@ -6757,10 +6764,10 @@ fun! s:LocalListing()
   if filelist !~ '[\\/]\.\.[\\/]\=\(\n\|$\)'
     " include ../ in the glob() entry if its missing
 "   call Decho("forcibly tacking on ..")
-   let filelist= filelist."\n".s:ComposePath(b:netrw_curdir,"../")
+   let filelist= filelist."\n".s:ComposePath(dirname,"../")
 "   call Decho("filelist<".filelist.">")
   endif
-  if b:netrw_curdir == '/'
+  if dirname == '/'
    " remove .. from filelist when current directory is root directory
 "   call Decho("remove .. from filelist")
    let filelist= substitute(filelist,'/\.\.\n','','')

Comment 6 errata-xmlrpc 2012-04-05 08:24:08 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2012-0454.html


Note You need to log in before you can comment on or make changes to this bug.