File tree 3 files changed +31
-8
lines changed
3 files changed +31
-8
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,10 @@ function! codequery#run_codequery(args) abort
53
53
call s: save_cwd ()
54
54
if ! s: check_filetype (&filetype )
55
55
echom ' Not Supported Filetype: ' . &filetype
56
+ if g: codequery_auto_switch_to_find_text_for_wrong_filetype
57
+ silent execute g: codequery_find_text_cmd
58
+ call codequery#query#prettify_qf_layout_and_map_keys (getqflist ())
59
+ endif
56
60
return
57
61
endif
58
62
@@ -63,6 +67,9 @@ function! codequery#run_codequery(args) abort
63
67
let g: codequery_db_path = ' '
64
68
if ! s: set_db ()
65
69
call s: restore_cwd ()
70
+ if g: codequery_trigger_build_db_when_db_not_found
71
+ execute ' CodeQueryMakeDB ' . &filetype
72
+ endif
66
73
return
67
74
endif
68
75
@@ -131,7 +138,7 @@ function! codequery#make_codequery_db(args) abort
131
138
endif
132
139
133
140
if v: version >= 800
134
- echom ' Making ...'
141
+ echom ' Making DB ...'
135
142
let mydict = {' db_path' : db_path,
136
143
\' callback': function (" codequery#db#make_db_callback" )}
137
144
let options = {' out_io' : ' null' ,
Original file line number Diff line number Diff line change @@ -42,15 +42,13 @@ function! codequery#menu#use_unite_menu(magic) abort
42
42
43
43
" DB not found => remove unnecessary items from menu
44
44
let db_path = codequery#db#find_db_path (&filetype )
45
- if empty (db_path)
46
- let menu_frequent_cmds =
47
- \[ [' ▷ Find Text' , g: codequery_find_text_cmd ],
48
- \ [' ▷ Make DB' , ' call feedkeys(":CodeQueryMakeDB ' . &filetype . ' ")' ]]
45
+ if empty (db_path) && &filetype !=# ' qf'
46
+ let menu_frequent_cmds = [[' ▷ Find Text' , g: codequery_find_text_cmd ]]
49
47
let menu_function_cmds = []
50
48
let menu_class_cmds = []
51
49
let menu_other_cmds = []
52
50
let menu_delimiter = []
53
- let menu_db_cmds = []
51
+ let menu_db_cmds = [[ ' ▷ Make DB ' , ' call feedkeys(":CodeQueryMakeDB ' . & filetype . ' ") ' ] ]
54
52
let menu_goto_magic = []
55
53
let menu_goto_full = []
56
54
if index (g: codequery_supported_filetype_list , &filetype ) == -1
Original file line number Diff line number Diff line change 1
1
" Copyright (c) 2016 excusemejoe
2
2
" MIT License
3
3
4
+
5
+ if exists (' g:loaded_loaded_codequery' )
6
+ finish
7
+ endif
8
+ let g: loaded_codequery = 1
9
+
10
+
4
11
" =============================================================================
5
12
" Options
6
13
7
14
" Init with default value
8
- let g: codequery_find_text_cmd = ' Ack!'
9
- let g: codequery_find_text_from_current_file_dir = 0
15
+ if ! exists (' g:codequery_find_text_cmd' )
16
+ let g: codequery_find_text_cmd = ' Ack!'
17
+ endif
18
+ if ! exists (' g:codequery_find_text_from_current_file_dir' )
19
+ let g: codequery_find_text_from_current_file_dir = 0
20
+ endif
21
+ if ! exists (' g:codequery_auto_switch_to_find_text_for_wrong_filetype' )
22
+ let g: codequery_auto_switch_to_find_text_for_wrong_filetype = 0
23
+ endif
24
+ if ! exists (' g:codequery_trigger_build_db_when_db_not_found' )
25
+ let g: codequery_trigger_build_db_when_db_not_found = 0
26
+ endif
27
+
10
28
11
29
12
30
" No need to init
You can’t perform that action at this time.
0 commit comments