Adds save ex-mode command
This commit is contained in:
parent
545f13294e
commit
117d7439ad
1 changed files with 8 additions and 0 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue