6
6
" Note: This file is encoded in UTF-8 including a byte order mark so
7
7
" that Vim loads the script using the right encoding transparently.
8
8
9
- let g: xolox #notes#version = ' 0.17.6 '
9
+ let g: xolox #notes#version = ' 0.17.7 '
10
10
let s: scriptdir = expand (' <sfile>:p:h' )
11
11
12
12
call xolox#misc#compat#check (' notes' , 1 )
@@ -673,13 +673,15 @@ endfunction
673
673
674
674
function ! s: vimgrep_wrapper (bang , pattern, files ) " {{{2
675
675
" Search for {pattern} in {files} using :vimgrep.
676
+ let starttime = xolox#misc#timer#start ()
676
677
let args = map (copy (a: files ), ' fnameescape(v:val)' )
677
678
call insert (args , a: pattern . ' j' )
678
679
let s: swaphack_enabled = 1
679
680
try
680
681
let ei_save = &eventignore
681
682
set eventignore = syntax ,bufread
682
683
execute ' vimgrep' . a: bang join (args )
684
+ call xolox#misc#timer#stop (" notes.vim %s: Populated quick-fix window in %s." , g: xolox #notes#version , starttime)
683
685
finally
684
686
let &eventignore = ei_save
685
687
unlet s: swaphack_enabled
@@ -697,8 +699,10 @@ endfunction
697
699
698
700
function ! s: run_scanner (keywords, matches) " {{{2
699
701
" Try to run scanner.py script to find notes matching {keywords}.
702
+ call xolox#misc#msg#info (" notes.vim %s: Searching notes using keyword index .." , g: xolox #notes#version )
700
703
let lines = s: python_command (a: keywords )
701
704
if type (lines ) == type ([])
705
+ call xolox#misc#msg#debug (" notes.vim %s: Search script reported %i matching note%s." , g: xolox #notes#version , len (lines ), len (lines ) == 1 ? ' ' : ' s' )
702
706
call extend (a: matches , lines )
703
707
return 1
704
708
endif
@@ -718,7 +722,7 @@ function! s:python_command(...) " {{{2
718
722
let script = xolox#misc#path#absolute (g: notes_indexscript )
719
723
let python = executable (' python2' ) ? ' python2' : ' python'
720
724
if ! (executable (python ) && filereadable (script ))
721
- call xolox#misc#msg#debug (" notes.vim %s: The %s script isn't executable. " , g: xolox #notes#version , script )
725
+ call xolox#misc#msg#debug (" notes.vim %s: We can't execute the %s script! " , g: xolox #notes#version , script )
722
726
else
723
727
let options = [' --database' , g: notes_indexfile , ' --notes' , g: notes_directory ]
724
728
if &ignorecase
@@ -735,9 +739,11 @@ function! s:python_command(...) " {{{2
735
739
call xolox#misc#msg#warn (" notes.vim %s: Search script failed with output: %s" , g: xolox #notes#version , output)
736
740
else
737
741
let lines = split (output, " \n " )
742
+ call xolox#misc#msg#debug (" notes.vim %s: Search script output: %s" , g: xolox #notes#version , string (lines ))
738
743
if ! empty (lines ) && lines [0 ] == ' Python works fine!'
739
744
return lines [1 :]
740
745
endif
746
+ call xolox#misc#msg#debug (" notes.vim %s: Search script returned invalid output :-(" , g: xolox #notes#version )
741
747
endif
742
748
endif
743
749
endfunction
0 commit comments