Shift+Tab stopped working

Hello,

Shift+tab seemingly no longer unindents my code. It instead just indents as if I were just pressing tab.

I don’t think it’s my terminal as it works fine in nano.

I tried running ‘nvim --clean’ as well but still the same result.

Any ideas?

(Arch Alacritty [Kitty same result])

I couldn’t figure it out so I just coded my own and mapped it to shift+tab.

function insert_mode_unindent()
    local pos = vim.fn.getpos('.')
    pos = pos[3]
    local line = vim.api.nvim_get_current_line()

    -- If expandtab is false this will also delete \t
    if string.sub(line, pos - 1, pos - 1) ~= ' ' then
        local s = vim.api.nvim_replace_termcodes('<BS>', true, false, true)
        vim.api.nvim_feedkeys(s, 'nt', false)
        return
    end

    -- Calculate indent offset
    local width = vim.fn.shiftwidth()
    local offset = math.fmod(pos - 1, width)
    if offset == 0 then
        offset = width
    end

    -- Delete up to offset amount of space characters
    for i = 1, offset do
        if string.sub(line, pos - i, pos - i) == ' ' then
            -- <BS> can delete more than one character depending on various
            -- tab settings so we use <Del> instead
            local s = vim.api.nvim_replace_termcodes('<Left><Del>', true, false, true)
            vim.api.nvim_feedkeys(s, 'nt', false)
        else
            break
        end
    end
end

vim.keymap.set('i', '<S-Tab>', insert_mode_unindent, {noremap = true, silent = true})