uga-rosa/translate.nvim

Unexpected behavior of `-output=register`

askfiy opened this issue · 1 comments

My setup is:

    M.translate.setup({
        default = {
            command = "translate_shell",
            output = "floating",
            parse_before = "trim",
            parse_after = "replace_symbols",
        },
        preset = {
            output = {
                split = {
                    min_size = 8,
                },
            },
        },
        parse_after = {
            replace_symbols = {
                cmd = function(lines)
                    for index, char in ipairs(lines) do
                        if char:find("u003d") then
                            lines[index] = char:gsub("u003d", "=")
                        end
                    end
                    return lines
                end,
            },
        },
    })

I found that when using -output=register it doesn't seem to respect my settings.

Because when I use -output=split or -output=floating and other settings, newlines are well preserved.

Only when -output=replace is used, everything will be compressed into one line.

Thank you for reporting.
Fixed.