netrw.vim

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

netrw.vim

Aleksej-7

hi,
        there are some troubles with VIM. Type in your shell
        mkdir include
        mkdir include/net
        mkdir net
        vim
        :e net
        :vs include/net

netrw.vim try to reuse buffers and find it with help of bufname function that returns
short filename(:. In standart vim package netrw.vim is the only one plugin that use bufname function (except ocaml.vim).

from netrw.vim:
(line 2266)

" s:NetrwGetBuffer: {{{2
"   returns 0=cleared buffer
"           1=re-used buffer
fun! s:NetrwGetBuffer(islocal,dirname)
"  call Dfunc("s:NetrwGetBuffer(islocal=".a:islocal." dirname<".a:dirname.">) liststyle=".g:netrw_liststyle)
  let dirname= a:dirname

(line 2326)

    while ibuf <= buflast
     let bname= substitute(bufname(ibuf),'\\','/','g')        
     let bname= substitute(bname,'.\zs/$','','')
"     call Decho("  findbuf3: dirname<".dirname."> bufname(".ibuf.")<".bname.">")
     if bname != '' && dirname =~ '/'.bname.'/\=$' | break | endif   /* <<<<<<<<<<<--------------------   dirname="include/net/" bname="net/"  */
     if bname   =~ '^'.dirname.'/\=$' | break | endif
     if dirname =~ '^'.bname.'/$'     | break | endif
     let ibuf= ibuf + 1
    endwhile

diff -ur vim72/src/eval.c bufname/src/eval.c
--- vim72/src/eval.c 2008-08-07 23:37:22.000000000 +0400
+++ bufname/src/eval.c 2010-06-08 12:46:40.000000000 +0400
@@ -8520,8 +8520,8 @@
     ++emsg_off;
     buf = get_buf_tv(&argvars[0]);
     rettv->v_type = VAR_STRING;
-    if (buf != NULL && buf->b_fname != NULL)
- rettv->vval.v_string = vim_strsave(buf->b_fname);
+    if (buf != NULL && buf->b_ffname != NULL)
+ rettv->vval.v_string = vim_strsave(buf->b_ffname);
     else
  rettv->vval.v_string = NULL;
     --emsg_off;

--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php