Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vim7 compatiable issue #88

Open
1 of 3 tasks
tracyone opened this issue Sep 14, 2023 · 2 comments
Open
1 of 3 tasks

Vim7 compatiable issue #88

tracyone opened this issue Sep 14, 2023 · 2 comments

Comments

@tracyone
Copy link
Owner

tracyone commented Sep 14, 2023

  • run command callback support
  • function api compatiable
  • auto add cscope tags database
@tracyone
Copy link
Owner Author

diff --git a/autoload/te/complete.vim b/autoload/te/complete.vim
index 6ac81e9..8a87d31 100644
--- a/autoload/te/complete.vim
+++ b/autoload/te/complete.vim
@@ -13,7 +13,7 @@ function! te#complete#cstag(timer) abort
             call te#utils#EchoWarning(l:cmd."Can not find any definition...")
             let l:ret = -1
         endtry
-        let l:len=getqflist({'size':0}).size
+        let l:len=len(getqflist())
         if l:ret == 0 && l:len > 1
             :botright copen
         endif
@@ -57,7 +57,7 @@ function! te#complete#goto_def(open_type) abort
                 call te#utils#EchoWarning("Can not find any definition...")
                 let l:ret = -1
             endtry
-            let l:len=getqflist({'size':0}).size
+            let l:len=len(getqflist())
             if l:ret == 0 && l:len > 1
                 :botright copen
             endif
@@ -139,7 +139,7 @@ function! te#complete#csref(timer) abort
             call te#utils#EchoWarning("Can not find any refernces")
             let l:ret = -1
         endtry
-        let l:len=getqflist({'size':0}).size
+        let l:len=len(getqflist())
         if l:ret == 0 && l:len > 1
             :botright copen
         endif
@@ -168,7 +168,7 @@ function te#complete#lookup_reference(open_type) abort
             call te#utils#EchoWarning("Can not find any refernces")
             let l:ret = -1
         endtry
-        let l:len=getqflist({'size':0}).size
+        let l:len=len(getqflist())
         if l:ret == 0 && l:len > 1
             :botright copen
         endif

tracyone added a commit that referenced this issue Sep 14, 2023
Signed-off-by: tracyone <[email protected]>
@tracyone
Copy link
Owner Author

diff --git a/autoload/te/complete.vim b/autoload/te/complete.vim
index 8a87d31..1071dc0 100644
--- a/autoload/te/complete.vim
+++ b/autoload/te/complete.vim
@@ -36,33 +36,31 @@ function! te#complete#goto_def(open_type) abort
         if g:complete_plugin_type.cur_val ==# 'YouCompleteMe' 
             let l:ret=s:YcmGotoDef()
         endif
-    endif
-    if get(g:, 'feat_enable_lsp') == 1
+    elseif get(g:, 'feat_enable_lsp') == 1
         let l:ret=te#lsp#gotodefinion()
+    else
+        let l:ret = -1 
     endif
+
     if te#env#SupportTimer() && l:ret == 0
         call timer_start(200, function('te#complete#cstag'), {'repeat': 1})
-    else
-        if l:ret < 0
-            let l:ret = 0
-            if te#env#SupportCscope()
-                "cscope and ctags combine
-                let l:cmd = ':cstag '.s:cur_word
-            else
-                let l:cmd = ':tselect '.s:cur_word
-            endif
-            try
-                execute  l:cmd
-            catch /^Vim\%((\a\+)\)\=:E/	
-                call te#utils#EchoWarning("Can not find any definition...")
-                let l:ret = -1
-            endtry
-            let l:len=len(getqflist())
-            if l:ret == 0 && l:len > 1
-                :botright copen
-            endif
+    elseif l:ret < 0
+        let l:ret = 0
+        if te#env#SupportCscope()
+            "cscope and ctags combine
+            let l:cmd = ':cstag '.s:cur_word
         else
-            return 0
+            let l:cmd = ':tselect '.s:cur_word
+        endif
+        try
+            execute  l:cmd
+        catch /^Vim\%((\a\+)\)\=:E/	
+            call te#utils#EchoWarning("Can not find any definition...")
+            let l:ret = -1
+        endtry
+        let l:len=len(getqflist())
+        if l:ret == 0 && l:len > 1
+            :botright copen
         endif
     endif
     return l:ret
@@ -157,6 +155,8 @@ function te#complete#lookup_reference(open_type) abort
         let l:ret=te#lsp#references()
     elseif g:feat_enable_complete == 1 && g:complete_plugin_type.cur_val == "YouCompleteMe"
         :silent! YcmCompleter GoToReferences
+    else
+        let l:ret = -1 
     endif
     if te#env#SupportTimer() && l:ret == 0
         call timer_start(200, function('te#complete#csref'), {'repeat': 1})

tracyone added a commit that referenced this issue Sep 15, 2023
Signed-off-by: tracyone <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant