From c6efc0d46c461fe69d32c426844d7892831ae771 Mon Sep 17 00:00:00 2001 From: jazzpi Date: Mon, 15 Aug 2016 23:47:34 +0200 Subject: [PATCH] Add 'smartcase' option --- lib/vim-option.coffee | 12 ++++++++++++ spec/ex-commands-spec.coffee | 14 ++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/lib/vim-option.coffee b/lib/vim-option.coffee index 4d5968c..ddf4688 100644 --- a/lib/vim-option.coffee +++ b/lib/vim-option.coffee @@ -44,4 +44,16 @@ class VimOption nosb: => @nosplitbelow() + smartcase: => + atom.config.set("vim-mode.useSmartcaseForSearch", true) + + scs: => + @smartcase() + + nosmartcase: => + atom.config.set("vim-mode.useSmartcaseForSearch", false) + + noscs: => + @nosmartcase() + module.exports = VimOption diff --git a/spec/ex-commands-spec.coffee b/spec/ex-commands-spec.coffee index f4c30cf..72775f8 100644 --- a/spec/ex-commands-spec.coffee +++ b/spec/ex-commands-spec.coffee @@ -835,6 +835,20 @@ describe "the commands", -> submitNormalModeInputText(':set nosplitbelow') expect(atom.config.get('ex-mode.splitbelow')).toBe(false) + it "sets (no)s(mart)c(a)s(e)", -> + openEx() + submitNormalModeInputText(':set scs') + expect(atom.config.get('vim-mode.useSmartcaseForSearch')).toBe(true) + openEx() + submitNormalModeInputText(':set noscs') + expect(atom.config.get('vim-mode.useSmartcaseForSearch')).toBe(false) + openEx() + submitNormalModeInputText(':set smartcase') + expect(atom.config.get('vim-mode.useSmartcaseForSearch')).toBe(true) + openEx() + submitNormalModeInputText(':set nosmartcase') + expect(atom.config.get('vim-mode.useSmartcaseForSearch')).toBe(false) + describe "aliases", -> it "calls the aliased function without arguments", -> ExClass.registerAlias('W', 'w')