Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Accept an optional bookmark name argument

Closes #444
  • Loading branch information...
commit aa026c0b371af0681ea505a29a64b124e61aed0b 1 parent a14edbf
Timothy Mellor authored committed
Showing with 3 additions and 2 deletions.
  1. +2 −2 autoload/ctrlp/bookmarkdir.vim
  2. +1 −0  doc/ctrlp.txt
View
4 autoload/ctrlp/bookmarkdir.vim
@@ -112,12 +112,12 @@ fu! ctrlp#bookmarkdir#accept(mode, str)
en
endf
-fu! ctrlp#bookmarkdir#add(dir)
+fu! ctrlp#bookmarkdir#add(dir, ...)
let str = 'Directory to bookmark: '
let cwd = a:dir != '' ? a:dir : s:getinput(str, getcwd(), 'dir')
if cwd == '' | retu | en
let cwd = fnamemodify(cwd, ':p')
- let name = s:getinput('Bookmark as: ', cwd)
+ let name = a:0 && a:1 != '' ? a:1 : s:getinput('Bookmark as: ', cwd)
if name == '' | retu | en
let name = tr(name, ' ', ' ')
cal s:savebookmark(name, cwd)
View
1  doc/ctrlp.txt
@@ -1286,6 +1286,7 @@ Special thanks:~
* Zahary Karadjov <github.com/zah>
* Jo De Boeck <github.com/grimpy>
* Rudi Grinberg <github.com/rgrinberg>
+ * Timothy Mellor <github.com/mellort>
===============================================================================
CHANGELOG *ctrlp-changelog*
Please sign in to comment.
Something went wrong with that request. Please try again.