Add splitbelow and splitright options to :set
This commit is contained in:
parent
a59a6f9364
commit
7bec719a6f
2 changed files with 52 additions and 0 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -802,6 +802,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')
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue