@@ -74,13 +74,11 @@ local function register_mappings(options, mappings)
7474
7575 for name , command in pairs (mappings ) do
7676 -- this specific mapping is disabled
77- if not options [name ] then
78- return
79- end
77+ if options [name ] then
78+ assert (type (options [name ]) == " string" , string.format (" `%s` must be a string" , name ))
8079
81- assert (type (options [name ]) == " string" , string.format (" `%s` must be a string" , name ))
82- vim .api .nvim_set_keymap (" n" , options [name ], command , { silent = true })
83- vim .api .nvim_set_keymap (" v" , options [name ], command , { silent = true })
80+ vim .keymap .set ({ " n" , " v" }, options [name ], command )
81+ end
8482 end
8583end
8684
@@ -93,7 +91,7 @@ function SearchAndReplace.setup(options)
9391 SearchAndReplace .options = SearchAndReplace .defaults (options or {})
9492
9593 register_mappings (SearchAndReplace .options .mappings , {
96- search_and_replace_by_reference = " :SearchAndReplaceByReference<CR>" ,
94+ -- search_and_replace_by_reference = ":SearchAndReplaceByReference<CR>",
9795 replace_by_pattern = " :ReplaceByPattern<CR>" ,
9896 replace_by_reference = " :ReplaceByReference<CR>" ,
9997 replace_undo = " :ReplaceUndo<CR>" ,
0 commit comments