vim-dirvish icon indicating copy to clipboard operation
vim-dirvish copied to clipboard

respect b:did_ftplugin

Open haolian9 opened this issue 2 years ago • 3 comments

i tried to disable dirvish's default ftplugin/dirvish.vim by adding let b:did_ftplugin = 1 to stdpath('config')/ftplugin/dirvish.vim, but it does not work as expected.

haolian9 avatar Aug 25 '22 16:08 haolian9

idk what you mean by "breaks the sourcing order of ftplugin/dirvish.vim".

I can add support for b:did_ftplugin.

TODO: from :help ftplugin :

If you are writing a filetype plugin to be used by many people, they need a
chance to disable loading it.  Put this at the top of the plugin: >

	" Only do this when not done yet for this buffer
	if exists("b:did_ftplugin")
	  finish
	endif
	let b:did_ftplugin = 1

This also needs to be used to avoid that the same plugin is executed twice for
the same buffer (happens when using an ":edit" command without arguments).

Now users can disable loading the default plugin completely by making a
filetype plugin with only this line: >

	let b:did_ftplugin = 1

justinmk avatar Aug 25 '22 18:08 justinmk

oh, i was talking to this line which was pointed out by seaseandewar.

haolian9 avatar Aug 25 '22 19:08 haolian9

I can add support for b:did_ftplugin.

yeah, that's the behavior i am looking for.

haolian9 avatar Aug 25 '22 19:08 haolian9

i finallly realized how easy can this be fixed :) would you mind to have a look at this pr? @justinmk

haolian9 avatar Sep 22 '22 08:09 haolian9

after dug deeper, i dont think this is a bug. although this hardcode source existed since #105, i disabled this source in my fork and used for a couple week, i did not encounter any problems with my keymaps. i respect this setting and going to close this issue.

haolian9 avatar Sep 22 '22 12:09 haolian9