]> Sergey Matveev's repositories - dotfiles.git/blobdiff - vim/.vim/ftplugin/go/gogetdoc.vim
Fix byte index, workability at the end of the word
[dotfiles.git] / vim / .vim / ftplugin / go / gogetdoc.vim
index 199b39f3043b929250fbbac22fb26f798efaf869..c2aa3ac5d9eca631baec0d1207f3ff319a64f9d9 100644 (file)
@@ -17,12 +17,12 @@ function! GoGetDocGot(ch)
         return
     endif
     let msgs = msgs[2:]
-    let b:godocid = popup_atcursor(msgs[2:], {"wrap": 0, "title": msgs[0], "move": "word"})
+    let b:godocid = popup_atcursor(msgs[2:-2], {"wrap": 0, "title": msgs[0], "move": "word"})
 endfunction
 
 function! s:GoGetDoc()
     if exists("b:gogetdoc_job") && job_status(b:gogetdoc_job) == "run" | return | endif
-    let pos = line2byte(line(".")) + col(".") - 1
+    let pos = line2byte(line(".")) + col(".") - 2
     let cmdline = "gogetdoc -pos " . expand("%p") . ":#" . pos
     let b:gogetdoc_job = job_start(cmdline, {
         \"in_mode": "nl",