File tree Expand file tree Collapse file tree 3 files changed +19
-4
lines changed Expand file tree Collapse file tree 3 files changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -99,12 +99,14 @@ endfunction
99
99
function ! ref#K (mode )
100
100
try
101
101
call ref#jump (a: mode )
102
- catch /^ref:/
102
+ catch /^ref: The source is not registered: /
103
103
if a: mode == # ' visual'
104
104
call feedkeys (' gvK' , ' n' )
105
105
else
106
106
call feedkeys (' K' , ' n' )
107
107
endif
108
+ catch /^ref:/
109
+ call s: echoerr (v: exception )
108
110
endtry
109
111
endfunction
110
112
@@ -524,9 +526,18 @@ endfunction
524
526
function ! s: get_query (mode , source )
525
527
let [source , query] = [a: source , ' ' ]
526
528
if a: mode == # ' normal'
527
- let pos = getpos (' .' )
528
- let res = s: sources [source ].get_keyword ()
529
- call setpos (' .' , pos)
529
+ try
530
+ let pos = getpos (' .' )
531
+ let res = s: sources [source ].get_keyword ()
532
+ catch
533
+ let mes = v: exception
534
+ if mes = ~# ' ^Vim'
535
+ let mes .= " \n " . v: throwpoint
536
+ endif
537
+ throw printf (' ref: %s: %s' , source , mes )
538
+ finally
539
+ call setpos (' .' , pos)
540
+ endtry
530
541
if type (res ) == s: T .list && len (res ) == 2
531
542
let [source , query] = res
532
543
else
Original file line number Diff line number Diff line change @@ -337,6 +337,8 @@ get_keyword() *ref-source-attr-get_keyword()*
337
337
[{source-name} , {keyword} ] の形式のリストを返すことも
338
338
できます。この場合指定されたソースでキーワードが開かれ
339
339
ます。
340
+ キーワードが見つからない場合はエラーメッセージと共に例
341
+ 外を投げます。
340
342
341
343
complete({query} ) *ref-source-attr-complete()*
342
344
任意。コマンドラインの補完リストを返します。
Original file line number Diff line number Diff line change @@ -342,6 +342,8 @@ get_keyword() *ref-source-attr-get_keyword()*
342
342
The list of the form of [{source-name} , {keyword} ] can
343
343
be returned. In this case, the keyword is opened by
344
344
the specified source.
345
+ Throws an exception with an error message if keyword
346
+ is not found.
345
347
346
348
complete({query} ) *ref-source-attr-complete()*
347
349
Optional. Return the completion list for command-line.
You can’t perform that action at this time.
0 commit comments