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

Keep current alternate-file name while reading templates #1675

Merged
merged 1 commit into from
Mar 2, 2018

Conversation

cakturk
Copy link
Contributor

@cakturk cakturk commented Feb 12, 2018

vim-go doesn't keep the previous value of alternate-file register
while reading templates. As a result, you will not be able to go back
to the buffer you were editing.

Suppose you have a directory structure like:

.
├── cmd/
│   └── bar/
└── foo.go

And you are editing a file in vim:

$ vim foo.go

and then you decided to create a new go file like:

:e cmd/bar/bar.go

Once you finished with 'bar.go', you hit CTRL-^ to return to the
previously edited file (foo.go), but you unexpectedly end up in
$RTP/vim-go/templates/hello_world.go.

This PR addresses this issue by prefixing the :read command in
go#template#create() with :keepalt.

Signed-off-by: Cihangir Akturk <cakturk@gmail.com>
@codecov-io
Copy link

Codecov Report

Merging #1675 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1675   +/-   ##
=======================================
  Coverage   22.36%   22.36%           
=======================================
  Files          53       53           
  Lines        4226     4226           
=======================================
  Hits          945      945           
  Misses       3281     3281
Flag Coverage Δ
#nvim 16.91% <100%> (ø) ⬆️
#vim74 19.4% <100%> (ø) ⬆️
#vim80 21.15% <100%> (ø) ⬆️
Impacted Files Coverage Δ
autoload/go/template.vim 64.7% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cc0467c...76775e0. Read the comment docs.

@arp242 arp242 merged commit a7dd67d into fatih:master Mar 2, 2018
@arp242
Copy link
Contributor

arp242 commented Mar 2, 2018

Thanks!

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

Successfully merging this pull request may close these issues.

3 participants