NvChad / NvChad/ui

Cannot Use `<C-w>` in Renamer

Open
#554 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Lua
Stars
485
Forks
177
Avg merge
24m
Merged PRs (30d)
1

Description

While in renamer, pressing <C-w> to delete the word will enter normal mode, it treats it like you are trying to enter a different window.
The renamer will be stuck on screen.

Steps to reproduce:

  • open renamer
  • press ctrl+w to try to delete the word
  • press 'j' or 'k'

https://github.com/user-attachments/assets/1c0e70df-7520-42d8-98f2-dc54723223b2

A "fix" I have is to close the window once it loses focus:

-- after https://github.com/NvChad/ui/blob/3e67e9d5325fd47fdbc90ca00a147db2f3525754/lua/nvchad/lsp/renamer.lua#L74
vim.api.nvim_create_autocmd("WinLeave", {
    once = true,
    callback = function()
        if api.nvim_buf_is_valid(buf) then
            pcall(api.nvim_buf_delete, buf, { force = true })
        end
    end
})

But this doesn't solve the issue that I can't delete the whole word.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with lua/nvchad/lsp/renamer.lua around the linked line 74 and reproduce the renamer workflow with Ctrl-W. Trace how focus and key handling change when Ctrl-W enters normal mode, then verify that Ctrl-W deletes the word and that subsequent j or k input does not leave the renamer stuck on screen.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
70/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.