Merge pull request #159 from jazzpi/split-options-set

Add splitbelow and splitright options to `:set`
This commit is contained in:
Jasper v. B 2016-08-14 21:52:32 +02:00 committed by GitHub
commit aca7d3b990
2 changed files with 52 additions and 0 deletions

View file

@ -20,4 +20,28 @@ class VimOption
nonu: => nonu: =>
@nonumber() @nonumber()
splitright: =>
atom.config.set("ex-mode.splitright", true)
spr: =>
@splitright()
nosplitright: =>
atom.config.set("ex-mode.splitright", false)
nospr: =>
@nosplitright()
splitbelow: =>
atom.config.set("ex-mode.splitbelow", true)
sb: =>
@splitbelow()
nosplitbelow: =>
atom.config.set("ex-mode.splitbelow", false)
nosb: =>
@nosplitbelow()
module.exports = VimOption module.exports = VimOption

View file

@ -803,6 +803,34 @@ describe "the commands", ->
submitNormalModeInputText(':set nonumber') submitNormalModeInputText(':set nonumber')
expect(atom.config.get('editor.showLineNumbers')).toBe(false) expect(atom.config.get('editor.showLineNumbers')).toBe(false)
it "sets (no)sp(lit)r(ight)", ->
keydown(':')
submitNormalModeInputText(':set spr')
expect(atom.config.get('ex-mode.splitright')).toBe(true)
atom.commands.dispatch(editorElement, 'ex-mode:open')
submitNormalModeInputText(':set nospr')
expect(atom.config.get('ex-mode.splitright')).toBe(false)
atom.commands.dispatch(editorElement, 'ex-mode:open')
submitNormalModeInputText(':set splitright')
expect(atom.config.get('ex-mode.splitright')).toBe(true)
atom.commands.dispatch(editorElement, 'ex-mode:open')
submitNormalModeInputText(':set nosplitright')
expect(atom.config.get('ex-mode.splitright')).toBe(false)
it "sets (no)s(plit)b(elow)", ->
keydown(':')
submitNormalModeInputText(':set sb')
expect(atom.config.get('ex-mode.splitbelow')).toBe(true)
atom.commands.dispatch(editorElement, 'ex-mode:open')
submitNormalModeInputText(':set nosb')
expect(atom.config.get('ex-mode.splitbelow')).toBe(false)
atom.commands.dispatch(editorElement, 'ex-mode:open')
submitNormalModeInputText(':set splitbelow')
expect(atom.config.get('ex-mode.splitbelow')).toBe(true)
atom.commands.dispatch(editorElement, 'ex-mode:open')
submitNormalModeInputText(':set nosplitbelow')
expect(atom.config.get('ex-mode.splitbelow')).toBe(false)
describe "aliases", -> describe "aliases", ->
it "calls the aliased function without arguments", -> it "calls the aliased function without arguments", ->
ExClass.registerAlias('W', 'w') ExClass.registerAlias('W', 'w')