@@ -350,12 +350,13 @@ M.get_alias = function(char)
350350end
351351
352352-- Gets a delimiter pair for a user-inputted character.
353- --- @param char string | nil The user-given character.
353+ --- @param user_input user_input The user-given character, and number of times to repeat the delimiters .
354354--- @param line_mode boolean Whether or not the delimiters should be put on new lines.
355355--- @return delimiter_pair | nil @A pair of delimiters for the given input , or nil if not applicable.
356356--- @nodiscard
357- M .get_delimiters = function (char , line_mode )
358- char = M .get_alias (char )
357+ M .get_delimiters = function (user_input , line_mode )
358+ local utils = require (" nvim-surround.utils" )
359+ local char = M .get_alias (user_input .char )
359360 -- Get the delimiters, using invalid_key_behavior if the add function is undefined for the character
360361 local delimiters = M .get_add (char )(char )
361362 if delimiters == nil then
@@ -378,7 +379,7 @@ M.get_delimiters = function(char, line_mode)
378379 table.insert (lhs , " " )
379380 end
380381
381- return { lhs , rhs }
382+ return utils . repeat_delimiters ( { lhs , rhs }, user_input . count )
382383end
383384
384385-- Returns the add key for the surround associated with a given character, if one exists.
@@ -547,8 +548,7 @@ M.translate_opts = function(user_opts)
547548 local input = require (" nvim-surround.input" )
548549 local opts = {}
549550 for key , value in pairs (user_opts ) do
550- if key == " surrounds" then
551- elseif key == " indent_lines" then
551+ if key == " indent_lines" then
552552 opts [key ] = value or function () end
553553 else
554554 opts [key ] = value
0 commit comments