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

GoRun not focusing on the proper split in NeoVim #1806

Closed
yeshengm opened this issue Apr 20, 2018 · 3 comments
Closed

GoRun not focusing on the proper split in NeoVim #1806

yeshengm opened this issue Apr 20, 2018 · 3 comments
Labels

Comments

@yeshengm
Copy link

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

execute GoRun in neovim command mode

What did you expect to happen?

The cursor should focus on the terminal split as shown in #607

What happened instead?

The cursor goes back to code split.

Configuration (MUST fill this out):

  • vim-go version:
    latest

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

autocmd FileType go nmap <leader>c <Plug>(go-build)
autocmd FileType go nmap <leader>r <Plug>(go-run)
autocmd FileType go nmap <C-q> <Plug>(go-doc)
autocmd FileType go nmap <leader>i <Plug>(go-info)
autocmd FileType go nmap <leader>t <Plug>(go-test)
let g:go_list_type = "quickfix"
let g:go_fmt_command = "goimports"
let g:go_highlight_types = 1
  • Vim version (first three lines from :version):
    NVIM v0.3.0-dev
    Build type: RelWithDebInfo
    Lua 5.1

  • Go version (go version):
    go version go1.10.1 linux/amd64

  • Go environment (go env):

GOARCH="amd64"
GOBIN=""
GOCACHE="/home/manifold/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/manifold/repo/go"
GORACE=""
GOROOT="/opt/go"
GOTMPDIR=""
GOTOOLDIR="/opt/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build877161923=/tmp/go-build -gno-record-gcc-switches"
@fatih fatih added the neovim label May 8, 2018
@viniarck
Copy link

I also hit this issue. Meanwhile, I'm using this workaround, if you run multiple times you'll open multiple splits though:

 " execute the whole project
  nnoremap <silent><Leader>l :vsplit term://go run *.go<CR>
 " execute current file
  nnoremap <silent><Leader>b :vsplit term://go run %<CR>

@bhcleek
Copy link
Collaborator

bhcleek commented Jun 23, 2018

The current behavior of returning focus to the code window is intentional. See #1412 (comment)

@bhcleek bhcleek closed this as completed Jun 23, 2018
@SurpassAll
Copy link

My env is neovim. Actually, the cursor will focus on the code panel, but I want focus on the output panel when exec :GoRun. So, what should I do?

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