11local fzf = require " fzf_lib"
22local sorters = require " telescope.sorters"
33
4+ -- todo(clason): remove when dropping support for Nvim 0.12
5+ local nonnil = vim .nonnil or vim .F .if_nil
6+
47local case_enum = setmetatable ({
58 [" smart_case" ] = 0 ,
69 [" ignore_case" ] = 1 ,
112115
113116local fast_extend = function (opts , conf )
114117 local ret = {}
115- ret .case_mode = vim . F . if_nil (opts .case_mode , conf .case_mode )
116- ret .fuzzy = vim . F . if_nil (opts .fuzzy , conf .fuzzy )
118+ ret .case_mode = nonnil (opts .case_mode , conf .case_mode )
119+ ret .fuzzy = nonnil (opts .fuzzy , conf .fuzzy )
117120 return ret
118121end
119122
@@ -126,12 +129,12 @@ end
126129
127130return require (" telescope" ).register_extension {
128131 setup = function (ext_config , config )
129- local override_file = vim . F . if_nil (ext_config .override_file_sorter , true )
130- local override_generic = vim . F . if_nil (ext_config .override_generic_sorter , true )
132+ local override_file = nonnil (ext_config .override_file_sorter , true )
133+ local override_generic = nonnil (ext_config .override_generic_sorter , true )
131134
132135 local conf = {}
133- conf .case_mode = vim . F . if_nil (ext_config .case_mode , " smart_case" )
134- conf .fuzzy = vim . F . if_nil (ext_config .fuzzy , true )
136+ conf .case_mode = nonnil (ext_config .case_mode , " smart_case" )
137+ conf .fuzzy = nonnil (ext_config .fuzzy , true )
135138
136139 if override_file then
137140 config .file_sorter = wrap_sorter (conf )
0 commit comments