Permalink
Browse files

Accept an optional bookmark name argument

Closes #444
  • Loading branch information...
1 parent a14edbf commit aa026c0b371af0681ea505a29a64b124e61aed0b Timothy Mellor committed with Jul 18, 2013
Showing with 3 additions and 2 deletions.
  1. +2 −2 autoload/ctrlp/bookmarkdir.vim
  2. +1 −0 doc/ctrlp.txt
@@ -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
@@ -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*

0 comments on commit aa026c0

Please sign in to comment.