Skip to content

Commit

Permalink
Throw errors from Neovim
Browse files Browse the repository at this point in the history
  • Loading branch information
smolck committed Nov 25, 2020
1 parent 9f8e59f commit 4682017
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 4 additions & 0 deletions lib/src/neovim.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ class Nvim {
mpack.deserialize(data, extDecoder: ExtTypeDecoder());
switch (deserialized[0]) {
case RESPONSE:
if (deserialized[2] != null) {
// Throw any errors from Neovim.
throw deserialized[2][1];
}
// TODO(smolck): Verify `deserialized[1]` is the id.
nvim._waiting[deserialized[1]].complete(deserialized[3]);
break;
Expand Down
4 changes: 0 additions & 4 deletions test/neovim_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ void main() async {

test('windows work', () async {
var winBuf = await nvim.createBuf(true, false);
// TODO(smolck): Neovim errors for if you, say, don't use the required
// `relative` or `external` parameters, are completely silent. Should
// probably use exceptions for when Neovim returns the wrong thing or
// something.
var win = await nvim.openWin(winBuf, true, {
'relative': 'editor',
'width': 12,
Expand Down

0 comments on commit 4682017

Please sign in to comment.