Skip to content

Commit 69dc54b

Browse files
committed
Temporarily don't initialize runtime files in buffer test
Adding InitRuntimeFiles() to buffer_test.go has changed the behavior of this test: now it tests not just buffer editing per se, but also how well buffer editing works together with syntax highlighting (since InitRuntimeFiles() loads syntax files, and many of the test buffers match the json header pattern in the json.yaml syntax file, so they are "highlighted" as json). This revealed long existing races between buffer editing and syntax highlighting. Until we fix those races, temporarily disable InitRuntimeFiles() in this test.
1 parent c5d32f6 commit 69dc54b

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

internal/buffer/buffer_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ type operation struct {
2020

2121
func init() {
2222
ulua.L = lua.NewState()
23-
config.InitRuntimeFiles(false)
23+
// TODO: uncomment InitRuntimeFiles once we fix races between syntax
24+
// highlighting and buffer editing.
25+
// config.InitRuntimeFiles(false)
2426
config.InitGlobalSettings()
2527
config.GlobalSettings["backup"] = false
2628
config.GlobalSettings["fastdirty"] = true

internal/config/rtfiles.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ type RuntimeFile interface {
3939
var allFiles [][]RuntimeFile
4040
var realFiles [][]RuntimeFile
4141

42+
func init() {
43+
initRuntimeVars()
44+
}
45+
4246
func initRuntimeVars() {
4347
allFiles = make([][]RuntimeFile, NumTypes)
4448
realFiles = make([][]RuntimeFile, NumTypes)

0 commit comments

Comments
 (0)