After noticing lag when opening a directory in Netrw, I put the following in my 
~/.vim/ftplugin/netrw.vim to see if it was loading multiple times:

    if !exists('s:count')
      let s:count = 0
    endif
    let s:count += 1

    func! Count()
      return s:count
    endf

I started vim:

    vim foo.txt -u NORC +'set nocp' +'runtime! plugin/netrwPlugin.vim' 
+'filetype plugin on'

I opened the containing directory in netrw:

    :edit %:h

and checking s:count shows it did at least source my ftplugin file twice:

    :echo Count()
    2

I've played around with this and it increments the count by 1 when leaving a 
netrw buffer and by 2 when entering a netrw buffer. Navigating from one netrw 
buffer to another (e.g. moving up another level in the directory tree) 
increments the count by 3 (1 + 2).

I suspect it's related to autocommands for entering/leaving buffers, but 
haven't been able to get any further debugging.

I originally noticed this because opening a Netrw buffer had a noticeable delay 
and the cursor would flicker. It seems recent vim updates have fixed whatever 
was causing the delay and flicker, but the double-loading still occurs.

Any ideas how I might debug this further?

-- 
-- 
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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui