forked from onivim/oni2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…nivim#672) * Fix unsaved indicator * Add integration test * Formatting * Update package/lockfiles
- Loading branch information
Showing
12 changed files
with
100 additions
and
26 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 @@ | ||
open Oni_Model; | ||
open Oni_IntegrationTestLib; | ||
|
||
// Regression test case covering #600: | ||
// https://github.com/onivim/oni2/issues/600 | ||
// | ||
// Verify some simple cases around the file modified flag | ||
runTest(~name="RegressionFileModifiedIndication", (_, wait, _) => { | ||
wait(~name="Initial mode is normal", (state: State.t) => | ||
state.mode == Vim.Types.Normal | ||
); | ||
|
||
Vim.command("e regression-file-modified-indication.txt"); | ||
|
||
let id = Vim.Buffer.getCurrent() |> Vim.Buffer.getId; | ||
|
||
Vim.input("o"); | ||
Vim.input("a"); | ||
|
||
let validateBufferCondition = (f, state: State.t) => { | ||
let buffer = Selectors.getBufferById(state, id); | ||
switch (buffer) { | ||
| Some(v) => f(v) | ||
| None => false | ||
}; | ||
}; | ||
|
||
wait(~name="Wait for modified flag to be set", (state: State.t) => | ||
validateBufferCondition(b => Buffer.isModified(b) == true, state) | ||
); | ||
|
||
// Save file, should clear modified flag | ||
Vim.input("<esc>"); | ||
Vim.command("w"); | ||
|
||
wait(~name="Wait for modified flag to be set", (state: State.t) => | ||
validateBufferCondition(b => Buffer.isModified(b) == false, state) | ||
); | ||
|
||
// Make another modification, should set it again | ||
Vim.input("o"); | ||
Vim.input("a"); | ||
|
||
wait(~name="Wait for modified flag to be set", (state: State.t) => | ||
validateBufferCondition(b => Buffer.isModified(b) == true, state) | ||
); | ||
}); |
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
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
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