From ccf6aa22f87a16e9a642f2d7451d3f19d1eb30d8 Mon Sep 17 00:00:00 2001 From: jazzpi Date: Wed, 15 Mar 2017 13:55:20 +0100 Subject: [PATCH] Fix `:x` closing Atom instead of the current pane `x` was being matched with `xall` instead of `xit`, so add an alias. --- lib/ex.coffee | 1 + spec/ex-commands-spec.coffee | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/lib/ex.coffee b/lib/ex.coffee index b3d7513..5edf5a8 100644 --- a/lib/ex.coffee +++ b/lib/ex.coffee @@ -276,6 +276,7 @@ class Ex xit: (args) => @wq(args) + x: (args) => @xit(args) split: ({ range, args }) -> args = args.trim() diff --git a/spec/ex-commands-spec.coffee b/spec/ex-commands-spec.coffee index 2054a38..cc349ac 100644 --- a/spec/ex-commands-spec.coffee +++ b/spec/ex-commands-spec.coffee @@ -485,6 +485,13 @@ describe "the commands", -> submitNormalModeInputText('xit') expect(Ex.wq).toHaveBeenCalled() + describe ":x", -> + it "acts as an alias to :xit", -> + spyOn(Ex, 'xit') + openEx() + submitNormalModeInputText('x') + expect(Ex.xit).toHaveBeenCalled() + describe ":wqall", -> it "calls :wall, then :quitall", -> spyOn(Ex, 'wall')