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

:GoDoc seems to be in vi compatibility mode #1739

Closed
inlined opened this issue Mar 26, 2018 · 7 comments
Closed

:GoDoc seems to be in vi compatibility mode #1739

inlined opened this issue Mar 26, 2018 · 7 comments
Labels

Comments

@inlined
Copy link

inlined commented Mar 26, 2018

What did you do? (required. The issue will be closed when not provided.)

Even when I add set nocompatible to my .vimrc, I'm having trouble with GoDoc. Whenever I hit an arrow key, it closes the :GoDoc window and adds a newline with the character associated with that arrow key.

What did you expect to happen?

For arrow keys to move the cursor work

What happened instead?

The GoDoc split closes, a new line in my original file is added, and it has the character associated with that arrow key.

Configuration (MUST fill this out):

  • Vim version (first two lines from :version):
    VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Mar 23 2018 09:25:20)
    macOS version

  • Go version (go version):
    go version go1.10 darwin/amd64

  • Go environment (go env):
    GOARCH="amd64"
    GOBIN=""
    GOCACHE="/Users/inlined/Library/Caches/go-build"
    GOEXE=""
    GOHOSTARCH="amd64"
    GOHOSTOS="darwin"
    GOOS="darwin"
    GOPATH="/Users/inlined/gopath"
    GORACE=""
    GOROOT="/Users/inlined/.homebrew/Cellar/go/1.10/libexec"
    GOTMPDIR=""
    GOTOOLDIR="/Users/inlined/.homebrew/Cellar/go/1.10/libexec/pkg/tool/darwin_amd64"
    GCCGO="gccgo"
    CC="clang"
    CXX="clang++"
    CGO_ENABLED="1"
    CGO_CFLAGS="-g -O2"
    CGO_CPPFLAGS=""
    CGO_CXXFLAGS="-g -O2"
    CGO_FFLAGS="-g -O2"
    CGO_LDFLAGS="-g -O2"
    PKG_CONFIG="pkg-config"
    GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/lh/52s939yd4m35fcf7f1kp8850003t3z/T/go-build929448649=/tmp/go-build -gno-record-gcc-switches -fno-common"

  • vim-go version:
    v1.6

  • vimrc you used to reproduce (use a minimal vimrc with other plugins disabled; do not link to a 2,000 line vimrc):
    none (reproduced without vimrc)

@arp242
Copy link
Contributor

arp242 commented Apr 4, 2018

vim-go maps <Esc> to close the godoc buffer. What I suspect is going on is that Vim doesn't recognize the escape codes for your arrow keys, so it sees <Esc>[B (or whatever your terminal sends).

This doesn't really sound like a vim-go problem, but more of a general issue with your Vim/terminal/system?

@26000
Copy link

26000 commented May 7, 2018

The same for me, :h vim-go, for example, works perfectly, while :GoDoc closes on every arrow key, pageup/pagedown, etc press.

@dsymonds
Copy link
Contributor

I am also finding this after updating vim-go. Unfortunately the last time I updated was in June 2014, so there's a regression somewhere in that time period, but it's hard to narrow down (about 1900 commits).

@fatih
Copy link
Owner

fatih commented May 17, 2018

This doesn't happen with Neovim. I've checked the code again go/autoload/doc.vim and there is nothing special we do. I think this has something to do with Vim & Term interaction (because NeoVim doesn't close the window when you use you arrow keys)

@dsymonds
Copy link
Contributor

dsymonds commented May 17, 2018

I did a git bisect, and f478b53 is the commit at which this starts failing for me. If I git reset --hard f478b53^ then I'm back to a vim-go with a working :GoDoc.

@fatih
Copy link
Owner

fatih commented May 17, 2018

Thanks David, this is helpful. I'll look into it. I wonder what triggers this behavior.

@dsymonds
Copy link
Contributor

Thanks for the fix. Arrow keys work now, but PageUp/PageDown are now broken. :-(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants