Fix byte index, workability at the end of the word
authorSergey Matveev <stargrave@stargrave.org>
Wed, 18 Dec 2019 18:10:39 +0000 (21:10 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Wed, 18 Dec 2019 18:10:39 +0000 (21:10 +0300)
vim/.vim/ftplugin/go/gogetdoc.vim

index 3dee9b403ddaf6a3892f1faa027a25cf3e495130..c2aa3ac5d9eca631baec0d1207f3ff319a64f9d9 100644 (file)
@@ -22,7 +22,7 @@ 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",