File plugin/qthelp.vim changed (mode: 100644) (index 8599f2e..52b7f76) |
... |
... |
command! -nargs=1 QHelp call QHHelp('<args>') |
92 |
92 |
" underneath the cursor |
" underneath the cursor |
93 |
93 |
function! QHHelp(query) |
function! QHHelp(query) |
94 |
94 |
call s:QHDebug('QHDBG: QHHelp(cword="'.a:query.'")') |
call s:QHDebug('QHDBG: QHHelp(cword="'.a:query.'")') |
95 |
|
if a:query != '' |
|
96 |
|
let l:lst = s:QHGetTagsList(a:query) |
|
97 |
|
else |
|
|
95 |
|
if empty(a:query) |
98 |
96 |
let l:lst = s:QHGetTagsListUC() |
let l:lst = s:QHGetTagsListUC() |
|
97 |
|
else |
|
98 |
|
let l:lst = s:QHGetTagsList(a:query) |
99 |
99 |
endif |
endif |
100 |
100 |
|
|
101 |
|
if len(l:lst) == 0 |
|
|
101 |
|
if empty(l:lst) |
102 |
102 |
call s:QHTellUser("Nothing was found") |
call s:QHTellUser("Nothing was found") |
103 |
103 |
else |
else |
104 |
104 |
call s:QHDebug('QHDBG: QHHelp, filename="'.l:lst[0]['filename'].'"') |
call s:QHDebug('QHDBG: QHHelp, filename="'.l:lst[0]['filename'].'"') |
|
... |
... |
function! s:QHGetTagsListUC() |
112 |
112 |
" wuc is for Word Underneath the Cursor |
" wuc is for Word Underneath the Cursor |
113 |
113 |
let l:wuc = expand('<cword>') |
let l:wuc = expand('<cword>') |
114 |
114 |
let l:lst = taglist('//apple_ref/cpp/cl//'.l:wuc.'$') |
let l:lst = taglist('//apple_ref/cpp/cl//'.l:wuc.'$') |
115 |
|
if len(l:lst) == 0 " if WUC is var_name |
|
|
115 |
|
if empty(l:lst) " if WUC is var_name |
116 |
116 |
let [l:class, b:membername] = QHGetVUCInfo() |
let [l:class, b:membername] = QHGetVUCInfo() |
117 |
|
if b:membername == '' |
|
|
117 |
|
if empty(b:membername) |
118 |
118 |
let l:lst = taglist('//apple_ref/cpp/cl//'.l:class.'$') |
let l:lst = taglist('//apple_ref/cpp/cl//'.l:class.'$') |
119 |
119 |
else |
else |
120 |
120 |
let l:lst = s:QHGetTagsListOnMember(l:class, b:membername) |
let l:lst = s:QHGetTagsListOnMember(l:class, b:membername) |
121 |
|
if len(l:lst) == 0 |
|
|
121 |
|
if empty(l:lst) |
122 |
122 |
let b:membername = '' |
let b:membername = '' |
123 |
123 |
let l:lst = taglist('//apple_ref/cpp/cl//'.l:class.'$') |
let l:lst = taglist('//apple_ref/cpp/cl//'.l:class.'$') |
124 |
124 |
endif |
endif |
|
... |
... |
function! s:QHGetTagsListOnMember(class, member) |
143 |
143 |
return l:lst |
return l:lst |
144 |
144 |
endif |
endif |
145 |
145 |
|
|
146 |
|
if len(l:lst) == 0 |
|
|
146 |
|
if empty(l:lst) |
147 |
147 |
let l:lst = taglist('//apple_ref/cpp/clm/'.a:class.'/'.a:member.'$') |
let l:lst = taglist('//apple_ref/cpp/clm/'.a:class.'/'.a:member.'$') |
148 |
148 |
endif |
endif |
149 |
|
if len(l:lst) == 0 |
|
|
149 |
|
if empty(l:lst) |
150 |
150 |
let l:lst = taglist('//apple_ref/cpp/instm/'.a:class.'/'.a:member.'$') |
let l:lst = taglist('//apple_ref/cpp/instm/'.a:class.'/'.a:member.'$') |
151 |
151 |
endif |
endif |
152 |
|
if len(l:lst) == 0 |
|
|
152 |
|
if empty(l:lst) |
153 |
153 |
let l:lst = taglist('//apple_ref/cpp/econst/'.a:class.'/'.a:member.'$') |
let l:lst = taglist('//apple_ref/cpp/econst/'.a:class.'/'.a:member.'$') |
154 |
154 |
endif |
endif |
155 |
|
if len(l:lst) == 0 |
|
|
155 |
|
if empty(l:lst) |
156 |
156 |
let l:lst = taglist('//apple_ref/cpp/tag/'.a:class.'/'.a:member.'$') |
let l:lst = taglist('//apple_ref/cpp/tag/'.a:class.'/'.a:member.'$') |
157 |
157 |
endif |
endif |
158 |
158 |
return l:lst |
return l:lst |
|
... |
... |
function! s:QHGetTagsList(query) |
170 |
170 |
let l:member = substitute(a:query, l:regex, '\2', '') |
let l:member = substitute(a:query, l:regex, '\2', '') |
171 |
171 |
call s:QHDebug('QHDBG: QHGetTagsList, member="'.l:member.'"') |
call s:QHDebug('QHDBG: QHGetTagsList, member="'.l:member.'"') |
172 |
172 |
let l:lst = taglist('//apple_ref/cpp/clm/'.l:class.'/'.l:member.'$') |
let l:lst = taglist('//apple_ref/cpp/clm/'.l:class.'/'.l:member.'$') |
173 |
|
if len(l:lst) == 0 |
|
|
173 |
|
if empty(l:lst) |
174 |
174 |
let l:lst = taglist('//apple_ref/cpp/instm/' |
let l:lst = taglist('//apple_ref/cpp/instm/' |
175 |
175 |
\.l:class.'/'.l:member.'$') |
\.l:class.'/'.l:member.'$') |
176 |
176 |
endif |
endif |
177 |
|
if len(l:lst) == 0 |
|
|
177 |
|
if empty(l:lst) |
178 |
178 |
let l:lst = taglist('//apple_ref/cpp/tag/' |
let l:lst = taglist('//apple_ref/cpp/tag/' |
179 |
179 |
\.l:class.'/'.l:member.'$') |
\.l:class.'/'.l:member.'$') |
180 |
180 |
endif |
endif |
|
... |
... |
function! QHGetVUCInfo() |
247 |
247 |
let l:wuctype = s:QHGetWUCType(wuc) |
let l:wuctype = s:QHGetWUCType(wuc) |
248 |
248 |
if l:wuctype == 0 " we're assuming that this is varname |
if l:wuctype == 0 " we're assuming that this is varname |
249 |
249 |
let l:varname = s:QHGetVarType(l:wuc) |
let l:varname = s:QHGetVarType(l:wuc) |
250 |
|
if l:varname == '' |
|
|
250 |
|
if empty(l:varname) |
251 |
251 |
return [l:wuc, ''] |
return [l:wuc, ''] |
252 |
252 |
else |
else |
253 |
253 |
return [l:varname, ''] |
return [l:varname, ''] |