Hello I recently come across some limitations when trying to customize Netrw to my needs. Basically due to the way the pluging is designed the public interface is quite limited, most of the functions at local to the script and cant be called outside it. There is a "public" function netrw#Call() to call to "private" functions, but it only allow to call to functions with no arguments or functions that accept a list as an argument, here is my question in vim_use where I explain the problem: https://groups.google.com/forum/#!topic/vim_use/xWbzq1eXgjQ
So I have modified that function identify when the string has the function name and arguments and execute it, allowing to pass anything to the function. In my opinion is much more flexible than the current implementation, my patched version is backwards compatible. With the fix you can do things like: call netrw#Call('NetrwBookHistHandler(5,expand("%"))') Thanks P -- -- 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 vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
*** /mnt/c/opt/vim/vim80/autoload/netrw.vim 2017-06-28 23:07:56.000000000 +0100 --- netrw.vim 2017-12-19 00:01:41.777242500 +0000 *************** *** 18,23 **** --- 18,29 ---- " But be doers of the Word, and not only hearers, deluding your own selves {{{1 " (James 1:22 RSV) " =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- + + " Modified version for TDVim {{{1 + " Last Change: 19-Dec-2017. + " + "}}} + " Load Once: {{{1 if &cp || exists("g:loaded_netrw") finish *************** *** 10853,10862 **** --- 10859,10873 ---- " --------------------------------------------------------------------- " netrw#Call: allows user-specified mappings to call internal netrw functions {{{2 + " XXX: Function fixed below to support arbitrary arguments in calling function, + " not only no argument or list of arguments like the original version fun! netrw#Call(funcname,...) " call Dfunc("netrw#Call(funcname<".a:funcname.">,".string(a:000).")") if a:0 > 0 exe "call s:".a:funcname."(".string(a:000).")" + elseif a:funcname =~ '^\p\+(\p\+)$' + "echomsg "call s:".a:funcname + exe "call s:".a:funcname else exe "call s:".a:funcname."()" endif