-
-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
<c-u> support #276
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Hello, Mr. Bot. Please don't close this issue because it hasn't been resolved yet. |
i meet some problem like this, i think it's same type. (
|
) after i key backspace, it like (|
) i think follow is pretty goods (|) and key backspace again |
) i think backspace '(', matched ')' may be deleted. just like | |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Hi again Mr. Bot. I still have hope for this issue, don't close it yet please. |
local api = vim.api
local insertCursorCol = 0
vim.api.nvim_create_autocmd({ "InsertEnter" }, {
pattern = "*",
callback = function()
_, insertCursorCol = unpack(api.nvim_win_get_cursor(0));
end,
})
vim.keymap.set("i", "<C-u>", function()
local _, cursorCol = unpack(api.nvim_win_get_cursor(0));
local colDistance = cursorCol - insertCursorCol
local backspaces = ''
for i = 1, colDistance, 1 do
backspaces = backspaces .. '<BS>'
end
return backspaces
end, { remap = true, expr = true }) this calls nvim-autopair's backspace using recursive mapping. |
Is your feature request related to a problem? Please describe.
Pressing
<c-u>
in insert mode once deletes everything to the left of the cursor up to the point where you entered insert mode. However, it leaves any parenthesis created to the right of the cursor.To illustrate, here's an example where we've just entered inser mode (
|
is the cursor):Pressing
(bar
produces this:Pressing
<c-u>
now produces this:But I would expect it to produce this (i.e. remove everything I inserted from insert mode):
The text was updated successfully, but these errors were encountered: