Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Changelog
=========

## develop

Bug fixes:

- [Vim Plugin] Goto reference in a modified file causes warning #477.

## 2018-05-20 0.5.0

Features:
Expand Down
1 change: 0 additions & 1 deletion plugin/phpactor.vim
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,6 @@ function! phpactor#_rpc_dispatch(actionName, parameters)
" >> open_file
if a:actionName == "open_file"
call phpactor#_switchToBufferOrEdit(a:parameters['path'])
exec ":edit"

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was here for a reason probably - for cases where the file has been modified on disk and should be reloaded.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cases where this might happen:

  • Replace references in current file
  • Generate method in new file
  • ??

Works on all of the above

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.. and if files have been changed on disk, VIM should warn about this.


if (a:parameters['offset'])
exec ":goto " . (a:parameters['offset'] + 1)
Expand Down
13 changes: 13 additions & 0 deletions plugin/tests/goto_reference.vader
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Given php:
<?php

use Phpactor\Phpactor;

new Phpactor();

Do:
/Phpactor\<Enter>nn
:call phpactor#GotoDefinition()\<Enter>

Then:
AssertEqual "Phpactor.php", expand('%:t')