-
-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/govim: safely handle busy state changes for non-.go buffers (#823)
In 8926dec we backed out the changes for tracking all buffer changes. But in so doing we didn't properly handle the situation where the busy state changes and the cursor is in a non-go file. Fix that and add a test to verify we don't regress. Whilst we are at it: * consistently use GOVIM_test_SetUserBusy in our testscript tests * slightly refactor the types/consts used for getting the current cursor position Fixes #821
- Loading branch information
Showing
7 changed files
with
69 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
cmd/govim/testdata/scenario_default/busy_state_change_non_go_file.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Test that a busy state change (from busy to not) in a non go file | ||
# succeeds. This ensures we are correctly non trying to handle events | ||
# in non .go files | ||
|
||
vim ex 'call GOVIM_test_SetUserBusy(1)' | ||
vim ex 'e main.go' | ||
vim ex 'e other.txt' | ||
vim ex 'call GOVIM_test_SetUserBusy(0)' | ||
|
||
# Assert that we have received no error (Type: 1) or warning (Type: 2) log messages | ||
# Disabled pending resolution to https://github.com/golang/go/issues/34103 | ||
# errlogmatch -start -count=0 'LogMessage callback: &protocol\.LogMessageParams\{Type:(1|2), Message:".*' | ||
|
||
-- go.mod -- | ||
module mod.com | ||
|
||
go 1.12 | ||
-- main.go -- | ||
package main | ||
-- other.txt -- | ||
hello |
10 changes: 5 additions & 5 deletions
10
cmd/govim/testdata/scenario_default/reference_highlight.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters