Skip to content

Commit

Permalink
fixup! WIP: feat: BobProject from log entry
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasFeher committed May 21, 2024
1 parent 0d6336f commit e69f28a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions plugin/vim-bob.vim
Original file line number Diff line number Diff line change
Expand Up @@ -212,14 +212,15 @@ function! s:Project(bang, ...)
let l:line_nr = line('.')
let l:line = getline(l:line_nr)
while l:line !~ '^- '
echo l:line_nr . ': ' . l:line
if l:line_nr == 1
throw 'error: could not find a valid log entry'
endif
let l:line_nr = l:line_nr - 1
let l:line = getline(l:line_nr)
endwhile
" now we are at the begin of the entry
" parse package name
let l:package = l:line[2:-2]
" parse prefix
let l:line = getline(l:line_nr + 1)
let l:match = matchlist(l:line, ' prefix: \(.*\)')
Expand Down Expand Up @@ -247,7 +248,8 @@ function! s:Project(bang, ...)
if empty(l:match)
throw 'internal error: expected entry `arguments` at line ' . (l:line_nr + 4)
endif
let l:args.args = l:match[1]
let l:args_string = trim(l:match[1], '[]')
let l:args.args = split(l:args_string, ', ')
else
throw 'error: too few arguments or not a .vim-bob_project.log file'
endif
Expand Down

0 comments on commit e69f28a

Please sign in to comment.