Skip to content

Commit aa026c0

Browse files
Timothy Mellorkien
authored andcommitted
Accept an optional bookmark name argument
Closes #444
1 parent a14edbf commit aa026c0

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

autoload/ctrlp/bookmarkdir.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,12 @@ fu! ctrlp#bookmarkdir#accept(mode, str)
112112
en
113113
endf
114114

115-
fu! ctrlp#bookmarkdir#add(dir)
115+
fu! ctrlp#bookmarkdir#add(dir, ...)
116116
let str = 'Directory to bookmark: '
117117
let cwd = a:dir != '' ? a:dir : s:getinput(str, getcwd(), 'dir')
118118
if cwd == '' | retu | en
119119
let cwd = fnamemodify(cwd, ':p')
120-
let name = s:getinput('Bookmark as: ', cwd)
120+
let name = a:0 && a:1 != '' ? a:1 : s:getinput('Bookmark as: ', cwd)
121121
if name == '' | retu | en
122122
let name = tr(name, ' ', ' ')
123123
cal s:savebookmark(name, cwd)

doc/ctrlp.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1286,6 +1286,7 @@ Special thanks:~
12861286
* Zahary Karadjov <github.com/zah>
12871287
* Jo De Boeck <github.com/grimpy>
12881288
* Rudi Grinberg <github.com/rgrinberg>
1289+
* Timothy Mellor <github.com/mellort>
12891290

12901291
===============================================================================
12911292
CHANGELOG *ctrlp-changelog*

0 commit comments

Comments
 (0)