Skip to content
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

In Insert mode, the icon is added after the letter behind the cursor #13

Open
kaze-k opened this issue Jan 15, 2023 · 6 comments
Open
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@kaze-k
Copy link

kaze-k commented Jan 15, 2023

Hi, I like your plugin very much, but I found a problem in insert mode.
In Insert mode, the icon is added after the letter behind the cursor

like that
GIF 2023-1-15 19-29-19

I modified the function to get what I wanted

local function insert_user_choice_insert(choice)
	if choice then
		local split = vim.split(choice, " ")

		vim.api.nvim_put({ split[1] }, "", false, false)
		vim.api.nvim_feedkeys("a", "t", false)
	end
end

like that
GIF 2023-1-15 19-37-44

I don't know if this is a bug

@ziontee113
Copy link
Owner

Hi @kaze-k , this issue should be fixed at 66d37ce.
Please update your plugin to receive the changes.

Thank you for opening the issue 👍

@kaze-k
Copy link
Author

kaze-k commented Jan 16, 2023

It worked perfectly, thank you very much

@kaze-k kaze-k closed this as completed Jan 16, 2023
@kaze-k
Copy link
Author

kaze-k commented Jan 17, 2023

Hi @ziontee113 , sorry, I think there are still some questions, may this be the problem of neovim?

If there is an icon in front of the cursor, the next icon is added before that icon
GIF 2023-1-17 14-19-41

If there is a letter in front of the cursor, it will add the icon correctly, but if the cursor is second at the end, it will add the icon to the end of the line
GIF 2023-1-17 14-44-23

I don't care about this bug because the plugin already meets my needs, but it would be nice if it could be fixed

@ziontee113 ziontee113 reopened this Jan 17, 2023
@ziontee113
Copy link
Owner

This is really annoying for sure. Unfortunately I really don't know any way to fix this issue right now :(

@ziontee113 ziontee113 added help wanted Extra attention is needed bug Something isn't working labels Jan 17, 2023
@kaze-k
Copy link
Author

kaze-k commented Jan 17, 2023

I think it's a character length problem, because some icons or texts (ex: Chinese characters) are three characters, but I don't have a good suggestion to solve this problem either.
Maybe try this method to get the character length: vim.fn.col(".")

@ziontee113
Copy link
Owner

Welp.. it's sad to say but the more things I try the more I break it. I'll leave the issue open until this problem is resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants