diff --git a/lib/ex.coffee b/lib/ex.coffee index c0ae5fd..c91beb7 100644 --- a/lib/ex.coffee +++ b/lib/ex.coffee @@ -127,11 +127,11 @@ class Ex tabe: (args) => @tabedit(args) - tabnew: ({ range, args }) => - if args.trim() is '' + tabnew: (args) => + if args.args.trim() is '' atom.workspace.open() else - @tabedit(range, args) + @tabedit(args) tabclose: (args) => @quit(args) diff --git a/spec/ex-commands-spec.coffee b/spec/ex-commands-spec.coffee index cb5fc33..08237e3 100644 --- a/spec/ex-commands-spec.coffee +++ b/spec/ex-commands-spec.coffee @@ -496,6 +496,14 @@ describe "the commands", -> submitNormalModeInputText('tabnew') expect(atom.workspace.open).toHaveBeenCalled() + it "opens a new tab for editing when provided an argument", -> + spyOn(Ex, 'tabnew').andCallThrough() + spyOn(Ex, 'tabedit') + keydown(':') + submitNormalModeInputText('tabnew tabnew-test') + expect(Ex.tabedit) + .toHaveBeenCalledWith(Ex.tabnew.calls[0].args...) + describe ":split", -> it "splits the current file upwards/downward", -> pane = atom.workspace.getActivePane()