Adds save ex-mode command

This commit is contained in:
Robby 2017-08-06 21:23:41 -05:00
parent 545f13294e
commit 117d7439ad

View file

@ -133,6 +133,7 @@ class Ex
qall: => @quitall() qall: => @quitall()
tabedit: (args) => tabedit: (args) =>
if args.args.trim() isnt '' if args.args.trim() isnt ''
@edit(args) @edit(args)
@ -437,4 +438,11 @@ class Ex
throw new CommandError("No such option: #{option}") throw new CommandError("No such option: #{option}")
optionProcessor() optionProcessor()
sort: ({ range }) =>
range = [[range[0], 0], [range[1] + 1, 0]]
editor = atom.workspace.getActiveTextEditor()
text = editor.getTextInBufferRange(range)
sortedText = _.sortBy(text.split(/\n/)).join('\n')
editor.buffer.setTextInRange(range, sortedText)
module.exports = Ex module.exports = Ex