# Restore the cursor to the location where the command was invoked
setpos('.', save_curpos)
- if result > 0
+ if result > 0 && symTblFiltered->len() > 0
# A symbol is selected in the popup menu
# Set the previous cursor location mark. Instead of using setpos(), m' is
redraw!
cursor(4, 1)
+ var save_completeopt = &completeopt
+ set completeopt+=noselect,noinsert
feedkeys("A\<C-X>\<C-O>\<C-Y>", 'xt')
assert_equal(' printf(', getline('.'))
+ &completeopt = save_completeopt
:%bw!
enddef
:%bw!
enddef
+def g:Test_DocumentSymbol()
+ :silent! edit Xdocsymbol.c
+ sleep 200m
+ var lines: list<string> =<< trim END
+ void DocSymFunc1(void)
+ {
+ }
+ END
+ setline(1, lines)
+ g:WaitForServerFileLoad(0)
+ redraw!
+
+ v:errmsg = ''
+ :LspDocumentSymbol
+ sleep 50m
+ feedkeys("x\<CR>", 'xt')
+ popup_clear()
+ assert_equal('', v:errmsg)
+
+ :%bw!
+enddef
+
# TODO:
# 1. Add a test for autocompletion with a single match while ignoring case.
# After the full matched name is typed, the completion popup should still