Skip to content

Commit

Permalink
feat: Rename doge#generate#pattern() -> doge#pattern#generate()
Browse files Browse the repository at this point in the history
  • Loading branch information
kkoomen committed Nov 30, 2019
1 parent 7db29f7 commit 03c5263
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 15 deletions.
13 changes: 4 additions & 9 deletions autoload/doge.vim
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ function! doge#generate(arg) abort
\)
endif

let l:success = 0

" Store old search register.
let s:oldsearch = @/

Expand All @@ -40,15 +38,12 @@ function! doge#generate(arg) abort

if exists('b:doge_patterns')
for l:pattern in get(b:doge_patterns, b:doge_doc_standard)
if doge#generate#pattern(l:pattern) == v:false
if doge#pattern#generate(l:pattern) == v:false
continue
else
let l:success = v:true
endif
if l:success == v:true
call doge#activate()
endif
return l:success

call doge#activate()
return 1
endfor
endif
endfunction
Expand Down
2 changes: 1 addition & 1 deletion autoload/doge/generate.vim → autoload/doge/pattern.vim
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ let s:comment_placeholder = doge#helpers#placeholder()
""
" @public
" Generates a comment based on a given pattern.
function! doge#generate#pattern(pattern) abort
function! doge#pattern#generate(pattern) abort
" Assuming multiline function expressions won't be longer than 15 lines.
let l:lines_raw = getline('.', line('.') + 15)
let l:lines = map(l:lines_raw, { key, line ->
Expand Down
2 changes: 1 addition & 1 deletion autoload/doge/token.vim
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ function! s:token_replace(tokens, text) abort
" For JSDoc we replace the type hints 'typeA | type B' with 'typeA|typeB'.
let l:text = substitute(l:text, '\m\s*|\s*', '|', 'g')

" Empty lines will be added to the empty in the doge#generate#pattern()
" Empty lines will be added to the empty in the doge#pattern#generate()
" function and to indicate it should be prevented from rendering we have to
" add some kind of format. We use a dash '-' as an indication that it should
" be removed.
Expand Down
6 changes: 3 additions & 3 deletions doc/doge.txt
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,6 @@ doge#comment#deactivate_when_done() *doge#comment#deactivate_when_done()*
and will deactivate doge when there are no more TODO items left. Requires
|g:doge_comment_interactive| to be enabled.

doge#generate#pattern({pattern}) *doge#generate#pattern()*
Generates a comment based on a given pattern.

doge#helpers#count({word} [, {lnum_start}, {lnum_end} ])
*doge#helpers#count()*
Returns the amount of occurences of a word.
Expand Down Expand Up @@ -171,6 +168,9 @@ doge#helpers#deepextend() *doge#helpers#deepextend()*
doge#indent#add({lnum}, {text}) *doge#indent#add()*
Indent a string based on a given line its indent, based on the user setting.

doge#pattern#generate({pattern}) *doge#pattern#generate()*
Generates a comment based on a given pattern.

doge#python#file({path}, {args}) *doge#python#file()*
Run a python file using the py[3]file command.

Expand Down
2 changes: 1 addition & 1 deletion doc/tags
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ doge#comment#deactivate_when_done() doge.txt /*doge#comment#deactivate_when_done
doge#comment#jump() doge.txt /*doge#comment#jump()*
doge#comment#update_interactive_comment_info() doge.txt /*doge#comment#update_interactive_comment_info()*
doge#deactivate() doge.txt /*doge#deactivate()*
doge#generate#pattern() doge.txt /*doge#generate#pattern()*
doge#generate() doge.txt /*doge#generate()*
doge#helpers#count() doge.txt /*doge#helpers#count()*
doge#helpers#deepextend() doge.txt /*doge#helpers#deepextend()*
Expand All @@ -19,6 +18,7 @@ doge#helpers#keyseq() doge.txt /*doge#helpers#keyseq()*
doge#helpers#placeholder() doge.txt /*doge#helpers#placeholder()*
doge#helpers#trim() doge.txt /*doge#helpers#trim()*
doge#indent#add() doge.txt /*doge#indent#add()*
doge#pattern#generate() doge.txt /*doge#pattern#generate()*
doge#python#file() doge.txt /*doge#python#file()*
doge#token#extract() doge.txt /*doge#token#extract()*
doge#token#replace() doge.txt /*doge#token#replace()*
Expand Down

0 comments on commit 03c5263

Please sign in to comment.