Between Utils.prepend_line_number() and its only caller, there is a lot of conversions from list to string to list and back to string. Simplify all of this by making it accept and return a list of strings, which avoids unnecessary splitting and joining. The implementation was updated to use vim.iter():map() and string.format() for better performance and to align with the idiomatic functional style used elsewhere in the project. The name of the function has also been tweaked and is now "prepend_line_numbers()" to better reflect that it operates on a list of strings. The caller has been updated to match the new function signature.
19 KiB
19 KiB