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

rename: reload all files to reflect the new changes #855

Merged
merged 1 commit into from
May 14, 2016
Merged

Conversation

fatih
Copy link
Owner

@fatih fatih commented May 14, 2016

After a long time I had now some time to look at it. So first this can
be solved easily with

set autoread

But this is problematic and doesn't work well in Vim. Here is a mailing
list post (yeah I know it's 10 years old but hey it still applies!:
http://www.mail-archive.com/vim@vim.org/msg05900.html)

That's why people add additionaly an autocmd in form of:

set autoread
autocmd BufEnter *.go silent! checktime

This triggers automatically checktime, which triggers to reload any
other file that was changed outside Vim. This works perfectly for
:GoRename.

But we don't need the autocmd, that would otherwise call checktime for
every single buffer we enter. Instead we only call it explicitly if
:GoRename is being called.

Closes #351

After a long time I had now some time to look at it. So first this can
be solved easily with

```
set autoread
```

But this is problematic and doesn't work well in Vim. Here is a mailing
list post (yeah I know it's 10 years old but hey it still applies!:
http://www.mail-archive.com/vim@vim.org/msg05900.html)

That's why people add additionaly an autocmd in form of:

```
set autoread
autocmd BufEnter *.go silent! checktime
```

This triggers automatically checktime, which triggers to reload any
other file that was changed outside Vim. This works perfectly for
`:GoRename`.

But we don't need the autocmd, that would otherwise call checktime for
every single buffer we enter. Instead we only call it explicitly if
`:GoRename` is being called.

Closes #351
@fatih fatih merged commit fea6ef3 into master May 14, 2016
@fatih fatih deleted the fix-gorename branch May 15, 2016 10:55
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

1 participant