-
-
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: fix index out of range bug when flipping back to diagnosti…
- Loading branch information
Showing
4 changed files
with
71 additions
and
5 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
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,47 @@ | ||
# Test case that verifies we have a fix for github.com/govim/govim/issues/680 | ||
|
||
# Open main.go and verify we have one error | ||
vim ex 'e main.go' | ||
vimexprwait errors.golden GOVIMTest_getqflist() | ||
|
||
# Find references to x then select the second instance | ||
vim ex 'call cursor(5,5)' | ||
vim ex 'GOVIMReferences' | ||
vim ex 'execute \"normal \\<Down>\\<Enter>\"' | ||
|
||
# Now flip back to diagnostics mode | ||
vim ex ':GOVIMQuickfixDiagnostics' | ||
|
||
# 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 | ||
|
||
import "fmt" | ||
|
||
var x int | ||
|
||
func main() { | ||
fmt.Printf("%v, %v", x) | ||
} | ||
-- errors.golden -- | ||
[ | ||
{ | ||
"bufname": "main.go", | ||
"col": 2, | ||
"lnum": 8, | ||
"module": "", | ||
"nr": 0, | ||
"pattern": "", | ||
"text": "Printf format %v reads arg #2, but call has 1 arg", | ||
"type": "", | ||
"valid": 1, | ||
"vcol": 0 | ||
} | ||
] |
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