Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Allow to disable tail commands from an extension #501

Open
wants to merge 1 commit into from

1 participant

@esneider

Allow extensions that do not work on files or buffers (like 'undo', 'dir', etc), to disable tail command parsing. More precisely, disable this behaviour:

End the string with a colon ':' followed by a Vim command to execute that
command after opening the file. If you need to use ':' literally, escape it
with a backslash: '\:'.

The extension will have to:

call add(g:ctrlp_ext_vars, {'sanstail': 0})
@esneider esneider referenced this pull request in esneider/vim-recipes
Closed

Look into ctrlp ":" bug #1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 25, 2013
  1. @esneider
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 0 deletions.
  1. +3 −0  autoload/ctrlp.vim
View
3  autoload/ctrlp.vim
@@ -1831,6 +1831,9 @@ fu! s:sanstail(str)
\ substitute(a:str, '^\(@.*$\|\\\\\ze@\|\.\.\zs[.\/]\+$\)', '', 'g') : a:str
let [str, pat] = [substitute(str, '\\\\', '\', 'g'), '\([^:]\|\\:\)*$']
unl! s:optail
+ if !s:getextvar('sanstail')
+ retu str
+ en
if str =~ '\\\@<!:'.pat
let s:optail = matchstr(str, '\\\@<!:\zs'.pat)
let str = substitute(str, '\\\@<!:'.pat, '', '')
Something went wrong with that request. Please try again.