Mercurial > vim-gutentags
comparison autoload/gutentags.vim @ 148:b178f2251982
Only set `v:errmsg` when we throw an actual error.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Wed, 07 Dec 2016 21:20:50 -0800 |
parents | d566ec6cd2f7 |
children | 6b00f4383708 |
comparison
equal
deleted
inserted
replaced
147:d566ec6cd2f7 | 148:b178f2251982 |
---|---|
2 | 2 |
3 " Utilities {{{ | 3 " Utilities {{{ |
4 | 4 |
5 " Throw an exception message. | 5 " Throw an exception message. |
6 function! gutentags#throw(message) | 6 function! gutentags#throw(message) |
7 throw "gutentags: " . a:message | |
8 endfunction | |
9 | |
10 " Throw an exception message and set Vim's error message variable. | |
11 function! gutentags#throwerr(message) | |
7 let v:errmsg = "gutentags: " . a:message | 12 let v:errmsg = "gutentags: " . a:message |
8 throw v:errmsg | 13 throw v:errmsg |
9 endfunction | 14 endfunction |
10 | 15 |
11 " Prints a message if debug tracing is enabled. | 16 " Prints a message if debug tracing is enabled. |
352 \"' is already being updated. Skipping...") | 357 \"' is already being updated. Skipping...") |
353 elseif a:queue_mode == 0 | 358 elseif a:queue_mode == 0 |
354 echom "gutentags: The tags file is already being updated, " . | 359 echom "gutentags: The tags file is already being updated, " . |
355 \"please try again later." | 360 \"please try again later." |
356 else | 361 else |
357 call gutentags#throw("Unknown queue mode: " . a:queue_mode) | 362 call gutentags#throwerr("Unknown queue mode: " . a:queue_mode) |
358 endif | 363 endif |
359 return | 364 return |
360 endif | 365 endif |
361 | 366 |
362 " Switch to the project root to make the command line smaller, and make | 367 " Switch to the project root to make the command line smaller, and make |