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
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.
--- 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','','')
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