Mercurial > vim-gutentags
comparison plugin/gutentags.vim @ 202:b50b6d0f82dd
Refactor for Vim8/Neovim job support.
- Refactor all modules' `generate` methods to use a vaguely generic job API
wrapper that works for both Vim8 and Neovim jobs.
- Make the `statusline` method use new `User` autocommands driven by the
job-started/ended callbacks.
- Remove all the lock-file-related stuff.
- Better error/warning messages.
- Move a few things around.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Sat, 31 Mar 2018 18:42:54 -0700 |
parents | 2489b4b54d5c |
children | 18dbf8d02b4c |
comparison
equal
deleted
inserted
replaced
201:b41385032f86 | 202:b50b6d0f82dd |
---|---|
1 " gutentags.vim - Automatic ctags management for Vim | 1 " gutentags.vim - Automatic ctags management for Vim |
2 " Maintainer: Ludovic Chabant <http://ludovic.chabant.com> | 2 " Maintainer: Ludovic Chabant <http://ludovic.chabant.com> |
3 " Version: 0.0.1 | 3 " Version: 2.0.0 |
4 | 4 |
5 " Globals {{{ | 5 " Globals {{{ |
6 | 6 |
7 if (&cp || get(g:, 'gutentags_dont_load', 0)) | 7 if (&cp || get(g:, 'gutentags_dont_load', 0)) |
8 finish | 8 finish |
9 endif | 9 endif |
10 | 10 |
11 if v:version < 704 | 11 if v:version < 800 |
12 echoerr "gutentags: this plugin requires vim >= 7.4." | 12 echoerr "gutentags: this plugin requires vim >= 8.0." |
13 finish | |
14 endif | |
15 | |
16 if !(has('job') || (has('nvim') && exists('*jobwait'))) | |
17 echoerr "gutentags: this plugin requires the job API from Vim8 or Neovim." | |
13 finish | 18 finish |
14 endif | 19 endif |
15 | 20 |
16 let g:gutentags_debug = get(g:, 'gutentags_debug', 0) | 21 let g:gutentags_debug = get(g:, 'gutentags_debug', 0) |
17 | 22 |
51 let g:gutentags_generate_on_missing = get(g:, 'gutentags_generate_on_missing', 1) | 56 let g:gutentags_generate_on_missing = get(g:, 'gutentags_generate_on_missing', 1) |
52 let g:gutentags_generate_on_write = get(g:, 'gutentags_generate_on_write', 1) | 57 let g:gutentags_generate_on_write = get(g:, 'gutentags_generate_on_write', 1) |
53 let g:gutentags_generate_on_empty_buffer = get(g:, 'gutentags_generate_on_empty_buffer', 0) | 58 let g:gutentags_generate_on_empty_buffer = get(g:, 'gutentags_generate_on_empty_buffer', 0) |
54 let g:gutentags_file_list_command = get(g:, 'gutentags_file_list_command', '') | 59 let g:gutentags_file_list_command = get(g:, 'gutentags_file_list_command', '') |
55 | 60 |
61 let g:gutentags_use_jobs = get(g:, 'gutentags_use_jobs', has('job')) | |
62 | |
56 if !exists('g:gutentags_cache_dir') | 63 if !exists('g:gutentags_cache_dir') |
57 let g:gutentags_cache_dir = '' | 64 let g:gutentags_cache_dir = '' |
58 elseif !empty(g:gutentags_cache_dir) | 65 elseif !empty(g:gutentags_cache_dir) |
59 " Make sure we get an absolute/resolved path (e.g. expanding `~/`), and | 66 " Make sure we get an absolute/resolved path (e.g. expanding `~/`), and |
60 " strip any trailing slash. | 67 " strip any trailing slash. |
90 | 97 |
91 " }}} | 98 " }}} |
92 | 99 |
93 " Toggles and Miscellaneous Commands {{{ | 100 " Toggles and Miscellaneous Commands {{{ |
94 | 101 |
95 command! GutentagsUnlock :call gutentags#delete_lock_files() | |
96 | |
97 if g:gutentags_define_advanced_commands | 102 if g:gutentags_define_advanced_commands |
98 command! GutentagsToggleEnabled :let g:gutentags_enabled=!g:gutentags_enabled | 103 command! GutentagsToggleEnabled :let g:gutentags_enabled=!g:gutentags_enabled |
99 command! GutentagsToggleTrace :call gutentags#toggletrace() | 104 command! GutentagsToggleTrace :call gutentags#toggletrace() |
100 endif | 105 endif |
101 | 106 |