diff options
| author | Mike Vink <> | 2023-04-13 14:05:37 +0200 |
|---|---|---|
| committer | Mike Vink <> | 2023-04-13 14:05:56 +0200 |
| commit | cb9d4e0fb632b5a94077c9cf0d07e6796b2fa407 (patch) | |
| tree | 34a5aa3ce706681db5bf42785aef07bcd15218e6 /fnl/conf | |
| parent | 7851f00befe4e5123b054fbdefba3f37639ff492 (diff) | |
fixup
Diffstat (limited to 'fnl/conf')
| -rw-r--r-- | fnl/conf/pkgs/cmp.fnl | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/fnl/conf/pkgs/cmp.fnl b/fnl/conf/pkgs/cmp.fnl index 09bf0f7..6518f34 100644 --- a/fnl/conf/pkgs/cmp.fnl +++ b/fnl/conf/pkgs/cmp.fnl @@ -10,7 +10,9 @@ (local string-startswith-anyof (fn [str start-list] (var ret false) (each [_ start (ipairs start-list)] - (set ret (string-startswith str start))) + (do + (P ret) + (set ret (string-startswith str start)))) ret)) (local string-startswith-upper @@ -70,21 +72,16 @@ (cmp.setup.cmdline ":" {:matching {:disallow_prefix_unmatching true} :sources (cmp.config.sources [{:name :path}] - [{:name :cmdline_history - :keyword_pattern "^[ABCDEFHIJKLMNOPQRSTUVWXYZ].*" + [{:name :cmdline + :keyword_length 1 :entry_filter (fn [entry ctx] - (if (string-startswith-upper entry.completion_item.label) - true - false)) - :max_item_count 1} - {:name :cmdline - :keyword_length 2 - :entry_filter (fn [entry - ctx] - (if (string-startswith entry.completion_item.label - :w) - false + (if (string-startswith-anyof entry.completion_item.label + [:w + :sp]) + (do + (P entry.completion_item.label) + false) true))}]) :experimental {:ghost_text true} :preselect cmp.PreselectMode.Item @@ -109,4 +106,12 @@ (fallback) (vim.schedule fallback)))}})}))) +; {:name :cmdline_history +; :keyword_pattern "^[ABCDEFHIJKLMNOPQRSTUVWXYZ].*" +; :entry_filter (fn [entry +; ctx] +; (if (string-startswith-upper entry.completion_item.label) +; true +; false)) +; :max_item_count 1)}))) (cmp-setup cmp true) |
