added: quit all and saveAll then quit commands, respectively:qa and waq

This commit is contained in:
Caio Cutrim 2015-11-22 21:26:41 -03:00
parent 472ec2140e
commit 47238fab10

View file

@ -74,8 +74,13 @@ class Ex
quit: -> quit: ->
atom.workspace.getActivePane().destroyActiveItem() atom.workspace.getActivePane().destroyActiveItem()
quitAll: ->
atom.workspace.getPanes()[0].destroy()
q: => @quit() q: => @quit()
qa: => @quitAll()
tabedit: (range, args) => tabedit: (range, args) =>
if args.trim() isnt '' if args.trim() isnt ''
@edit(range, args) @edit(range, args)
@ -177,10 +182,15 @@ class Ex
@write(args...).then => @quit() @write(args...).then => @quit()
xit: (args...) => @wq(args...) xit: (args...) => @wq(args...)
saveAll: ->
wa: ->
atom.workspace.saveAll() atom.workspace.saveAll()
wa: =>
@saveAll()
waq: =>
@saveAll()
@quit()
split: (range, args) -> split: (range, args) ->
args = args.trim() args = args.trim()
filePaths = args.split(' ') filePaths = args.split(' ')
@ -199,9 +209,9 @@ class Ex
substitute: (range, args) -> substitute: (range, args) ->
args = args.trimLeft() args = args.trimLeft()
delim = args[0] delim = args[0]
if /[a-z1-9\\"|]/i.test(delim) if /[a-z]/i.test(delim)
throw new CommandError( throw new CommandError(
"Regular expressions can't be delimited by alphanumeric characters, '\\', '\"' or '|'") "Regular expressions can't be delimited by letters")
delimRE = new RegExp("[^\\\\]#{delim}") delimRE = new RegExp("[^\\\\]#{delim}")
spl = [] spl = []
args_ = args[1..] args_ = args[1..]