diff --git a/README.md b/README.md index 19eb898..f58af84 100644 --- a/README.md +++ b/README.md @@ -201,7 +201,7 @@ For cross-window search, traversal mode is not supported. ```Lua require('leap').setup { - case_insensitive = true, + case_sensitive = false, highlight_unlabeled = false, -- Leaving the appropriate list empty effectively disables "smart" mode, -- and forces auto-jump to be on or off. diff --git a/doc/leap.txt b/doc/leap.txt index 2e7d562..eb3d3e3 100644 --- a/doc/leap.txt +++ b/doc/leap.txt @@ -123,9 +123,9 @@ Setting multiple options via the `setup` function: > Available options~ -`case_insensitive = true` +`case_sensitive = false` - Ignore case in search patterns. + Whether to consider case in search patterns. `highlight_unlabeled = false` diff --git a/fnl/leap/main.fnl b/fnl/leap/main.fnl index 781ef15..f553748 100644 --- a/fnl/leap/main.fnl +++ b/fnl/leap/main.fnl @@ -429,7 +429,7 @@ Dynamic attributes easy iteration through each subset of targets with a given successor char separately." (tset targets :sublists {}) - (when opts.case_insensitive + (when-not opts.case_sensitive (setmetatable targets.sublists {:__index (fn [t k] (rawget t (k:lower))) :__newindex (fn [t k v] (rawset t (k:lower) v))})) @@ -674,7 +674,7 @@ B: Two labels occupy the same position (this can occur at EOL or window (fn prepare-pattern [in1 ?in2] (.. "\\V" - (if opts.case_insensitive "\\c" "\\C") + (if opts.case_sensitive "\\C" "\\c") (in1:gsub "\\" "\\\\") ; backslash needs to be escaped even for \V (match ?in2 ; but not here (no arbitrary input after this) spec-keys.eol (.. "\\(" ?in2 "\\|\\r\\?\\n\\)") diff --git a/fnl/leap/opts.fnl b/fnl/leap/opts.fnl index f8b6f54..69f22cf 100644 --- a/fnl/leap/opts.fnl +++ b/fnl/leap/opts.fnl @@ -1,4 +1,4 @@ -{:case_insensitive true +{:case_sensitive false :highlight_unlabeled false :safe_labels ["s" "f" "n" "u" "t" diff --git a/lua/leap/main.lua b/lua/leap/main.lua index 976ac9c..a06f1a2 100644 --- a/lua/leap/main.lua +++ b/lua/leap/main.lua @@ -522,7 +522,7 @@ local function get_targets(pattern, _78_) local line = _each_87_[1] local col = _each_87_[2] local _88_ = vim.fn.screenpos(winid, line, col) - if ((_G.type(_88_) == "table") and ((_88_).col == col) and (nil ~= (_88_).row)) then + if ((_G.type(_88_) == "table") and (nil ~= (_88_).row) and ((_88_).col == col)) then local row = (_88_).row cursor_positions[winid] = {row, col} else @@ -540,7 +540,7 @@ local function get_targets(pattern, _78_) local t = _each_92_ if by_screen_pos_3f then local _95_ = vim.fn.screenpos(winid, line, col) - if ((_G.type(_95_) == "table") and ((_95_).col == col) and (nil ~= (_95_).row)) then + if ((_G.type(_95_) == "table") and (nil ~= (_95_).row) and ((_95_).col == col)) then local row = (_95_).row t["screenpos"] = {row, col} else @@ -561,7 +561,7 @@ local function get_targets(pattern, _78_) end local function populate_sublists(targets) targets["sublists"] = {} - if opts.case_insensitive then + if not opts.case_sensitive then local function _101_(t, k) return rawget(t, k:lower()) end @@ -893,10 +893,10 @@ local function leap(_161_) spec_keys = setmetatable({}, {__index = _170_}) local function prepare_pattern(in1, _3fin2) local function _171_() - if opts.case_insensitive then - return "\\c" - else + if opts.case_sensitive then return "\\C" + else + return "\\c" end end local function _173_() diff --git a/lua/leap/opts.lua b/lua/leap/opts.lua index d1be37c..efcad0c 100644 --- a/lua/leap/opts.lua +++ b/lua/leap/opts.lua @@ -1 +1 @@ -return {case_insensitive = true, highlight_unlabeled = false, safe_labels = {"s", "f", "n", "u", "t", "/", "F", "L", "N", "H", "G", "M", "U", "T", "?", "Z"}, labels = {"s", "f", "n", "j", "k", "l", "o", "d", "w", "e", "h", "m", "v", "g", "u", "t", "c", ".", "z", "/", "F", "L", "N", "H", "G", "M", "U", "T", "?", "Z"}, special_keys = {repeat_search = "", next_match = "", prev_match = "", next_group = "", prev_group = "", eol = ""}} +return {case_sensitive = false, highlight_unlabeled = false, safe_labels = {"s", "f", "n", "u", "t", "/", "F", "L", "N", "H", "G", "M", "U", "T", "?", "Z"}, labels = {"s", "f", "n", "j", "k", "l", "o", "d", "w", "e", "h", "m", "v", "g", "u", "t", "c", ".", "z", "/", "F", "L", "N", "H", "G", "M", "U", "T", "?", "Z"}, special_keys = {repeat_search = "", next_match = "", prev_match = "", next_group = "", prev_group = "", eol = ""}}