1
1
" Vim auto-load script
2
2
" Author: Peter Odding <peter@peterodding.com>
3
- " Last Change: November 23 , 2011
3
+ " Last Change: November 24 , 2011
4
4
" URL: http://peterodding.com/code/vim/notes/
5
5
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.14.2 '
9
+ let g: xolox #notes#version = ' 0.14.3 '
10
10
11
11
function ! xolox#notes#shortcut () " {{{1
12
12
" The "note:" pseudo protocol is just a shortcut for the :Note command.
@@ -551,7 +551,11 @@ function! s:run_scanner(keywords, matches) " {{{2
551
551
endfunction
552
552
553
553
function ! xolox#notes#keyword_complete (arglead, cmdline, cursorpos) " {{{2
554
- return split (s: python_command (' --list=' . a: arglead ), ' \n' )
554
+ let first_run = ! filereadable (g: notes_indexfile )
555
+ if first_run | call inputsave () | endif
556
+ let keywords = split (s: python_command (' --list=' . a: arglead ), ' \n' )
557
+ if first_run | call inputrestore () | endif
558
+ return keywords
555
559
endfunction
556
560
557
561
function ! s: python_command (... ) " {{{2
@@ -564,6 +568,9 @@ function! s:python_command(...) " {{{2
564
568
let arguments = map ([script ] + options + a: 000 , ' xolox#misc#escape#shell(v:val)' )
565
569
let command = join ([python ] + arguments)
566
570
call xolox#misc#msg#debug (" notes.vim %s: Executing external command %s" , g: xolox #notes#version , command )
571
+ if ! filereadable (xolox#misc#path#absolute (g: notes_indexfile ))
572
+ call xolox#misc#msg#info (" notes.vim %s: Building keyword index (this might take a while) .." , g: xolox #notes#version )
573
+ endif
567
574
let output = xolox#misc#str#trim (system (command ))
568
575
if v: shell_error
569
576
call xolox#misc#msg#warn (" notes.vim %s: Search script failed with output: %s" , g: xolox #notes#version , output)
0 commit comments