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

Show correct message when editing a new file #1371

Merged
merged 1 commit into from Jul 24, 2017
Merged

Show correct message when editing a new file #1371

merged 1 commit into from Jul 24, 2017

Conversation

arp242
Copy link
Contributor

@arp242 arp242 commented Jul 23, 2017

When editing a new file:

vim newfile.go

Vim would show the results of the :0r command on startup:

"~/.vim/pack/plugins/start/vim-go/templates/hello_world.go" 7L, 67C

Instead of the default:

"newfile2.go" [New File]

This corrects that by adding running the :0r command with silent.

This would only occur if go#tool#PackageName() returns -1; the correct
message was already shown when a package is found.

There was an echon with a comment about removing the [New File] message, but
this seems like the wrong behaviour to me. Either way, it didn't work; maybe the
behaviour of echon subtly changed?

Fixes #1347

When editing a new file:

	vim newfile.go

Vim would show the results of the `:0r` command on startup:

	"~/.vim/pack/plugins/start/vim-go/templates/hello_world.go" 7L, 67C

Instead of the default:

	"newfile2.go" [New File]

This corrects that by adding running the `:0r` command with `silent`.

This would only occur if `go#tool#PackageName()` returns `-1`; the correct
message was already shown when a package is found.

There was an `echon` with a comment about removing the `[New File]` message, but
this seems like the wrong behaviour to me. Either way, it didn't work; maybe the
behaviour of `echon` subtly changed?

Fixes #1347
@fatih fatih merged commit 68c7016 into fatih:master Jul 24, 2017
@fatih
Copy link
Owner

fatih commented Jul 24, 2017

Thanks again @Carpetsmoker

@arp242 arp242 deleted the new-file branch July 24, 2017 12:34
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.

None yet

2 participants