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

Current working dir is wrong after running :GoRun in NeoVim #1289

Closed
dorons opened this issue May 14, 2017 · 4 comments · Fixed by #1296
Closed

Current working dir is wrong after running :GoRun in NeoVim #1289

dorons opened this issue May 14, 2017 · 4 comments · Fixed by #1296

Comments

@dorons
Copy link
Contributor

dorons commented May 14, 2017

Behavior

When executing :GoRun on an inner/nested main package within a project tree, the local current dir of the window from which :GoRun was commenced is changed to the path of the package main inner file and is no longer the project's root dir.

The issue seems to be that the go#term#newmode function changes lcd of the source (main.go) window and "restores" the original dir on the target window (terminal) instead.

Steps to reproduce:

  1. cd $GOPATH/src/scratch/mypkg
  2. Start nvim
  3. Open a sub-package main, such as: :e ./cmd/util/main.go
  4. :echo getcwd() => /Users/doron/go/src/scratch/mypkg
  5. :GoRun... main runs in NeoVim's terminal mode in a new window
  6. Go back to the main.go window
  7. :echo getcwd() => /Users/doron/go/src/scratch/mypkg/cmd/util (inner path)

Configuration

  • vim version: NVIM v0.2.0-1523-g5d73a6e
  • vim-go version: HEAD 7fb968
  • go version: go version go1.8 darwin/amd64
@fatih
Copy link
Owner

fatih commented May 22, 2017

Hi @dorons

Can you try please: #1296

I'm not using neovim so not sure if that fixes.

@fatih
Copy link
Owner

fatih commented May 27, 2017

Ping @dorons , can you please test it ?

@fatih
Copy link
Owner

fatih commented May 28, 2017

This is now in master. Let me know if you have still issues. Thanks.

@dorons
Copy link
Contributor Author

dorons commented May 30, 2017

Sorry for catching this late. Verified with master... works as advertized :)

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

Successfully merging a pull request may close this issue.

2 participants