Merge pull request #148 from brebory/bugfix/brebory/tabnew-with-args
Fix tabnew with arguments
This commit is contained in:
commit
96bdf4143c
2 changed files with 11 additions and 3 deletions
|
|
@ -127,11 +127,11 @@ class Ex
|
||||||
|
|
||||||
tabe: (args) => @tabedit(args)
|
tabe: (args) => @tabedit(args)
|
||||||
|
|
||||||
tabnew: ({ range, args }) =>
|
tabnew: (args) =>
|
||||||
if args.trim() is ''
|
if args.args.trim() is ''
|
||||||
atom.workspace.open()
|
atom.workspace.open()
|
||||||
else
|
else
|
||||||
@tabedit(range, args)
|
@tabedit(args)
|
||||||
|
|
||||||
tabclose: (args) => @quit(args)
|
tabclose: (args) => @quit(args)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -496,6 +496,14 @@ describe "the commands", ->
|
||||||
submitNormalModeInputText('tabnew')
|
submitNormalModeInputText('tabnew')
|
||||||
expect(atom.workspace.open).toHaveBeenCalled()
|
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", ->
|
describe ":split", ->
|
||||||
it "splits the current file upwards/downward", ->
|
it "splits the current file upwards/downward", ->
|
||||||
pane = atom.workspace.getActivePane()
|
pane = atom.workspace.getActivePane()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue