Accept an optional bookmark name argument

Closes #444
This commit is contained in:
Timothy Mellor 2013-07-18 12:04:23 -04:00 committed by Kien N
parent a14edbfc3d
commit aa026c0b37
2 changed files with 3 additions and 2 deletions

View File

@ -112,12 +112,12 @@ fu! ctrlp#bookmarkdir#accept(mode, str)
en en
endf endf
fu! ctrlp#bookmarkdir#add(dir) fu! ctrlp#bookmarkdir#add(dir, ...)
let str = 'Directory to bookmark: ' let str = 'Directory to bookmark: '
let cwd = a:dir != '' ? a:dir : s:getinput(str, getcwd(), 'dir') let cwd = a:dir != '' ? a:dir : s:getinput(str, getcwd(), 'dir')
if cwd == '' | retu | en if cwd == '' | retu | en
let cwd = fnamemodify(cwd, ':p') 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 if name == '' | retu | en
let name = tr(name, ' ', ' ') let name = tr(name, ' ', ' ')
cal s:savebookmark(name, cwd) cal s:savebookmark(name, cwd)

View File

@ -1286,6 +1286,7 @@ Special thanks:~
* Zahary Karadjov <github.com/zah> * Zahary Karadjov <github.com/zah>
* Jo De Boeck <github.com/grimpy> * Jo De Boeck <github.com/grimpy>
* Rudi Grinberg <github.com/rgrinberg> * Rudi Grinberg <github.com/rgrinberg>
* Timothy Mellor <github.com/mellort>
=============================================================================== ===============================================================================
CHANGELOG *ctrlp-changelog* CHANGELOG *ctrlp-changelog*