Forráskód Böngészése

Enable startup customization via `:autocmd User BufExplorer_Started`.

An autocommand is used to detect BufExplorer startup and run code to
adjust settings in the BufExplorer buffer; for example, to disable the
`t` command:

```
autocmd User BufExplorer_Started nmap <nowait> <buffer> t <Nop>
```
Michael Henry 9 hónapja
szülő
commit
749e60be3b
1 módosított fájl, 6 hozzáadás és 0 törlés
  1. 6 0
      plugin/bufexplorer.vim

+ 6 - 0
plugin/bufexplorer.vim

@@ -650,6 +650,12 @@ function! BufExplorer()
     " the active buffer.  The active buffer is the line with the '%' character
     " in it.
     execute search("%")
+
+    if exists('#User#BufExplorer_Started')
+        " Notify that BufExplorer has started.  This is an opportunity to make
+        " custom buffer-local mappings and the like.
+        doautocmd User BufExplorer_Started
+    endif
 endfunction
 
 " Tracks `tabId` at BufExplorer launch.