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

Error with typing Vietnamese using Telescope.nvim #3372

Open
brianhuster opened this issue Nov 29, 2024 · 0 comments
Open

Error with typing Vietnamese using Telescope.nvim #3372

brianhuster opened this issue Nov 29, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@brianhuster
Copy link

Description

When I type Vietnamese in telescope-nvim using ibus-bamboo IME, if I type a diacritics, it will auto change to normal mode.

Neovim version

NVIM v0.11.0-dev-1238+g66bb1e577c
Build type: RelWithDebInfo
LuaJIT 2.1.1731601260
Run "nvim -V1 -v" for more info

Operating system and version

Kubuntu 24.04.1

Telescope version / branch / rev

branch main

checkhealth telescope

Checking for required plugins ~
- OK plenary installed.
- OK nvim-treesitter installed.

Checking external dependencies ~
- OK rg: found ripgrep 14.1.0
- OK fd: found (unknown version)

===== Installed extensions ===== ~

Steps to reproduce

  1. Install ibus-bamboo
echo | sudo add-apt-repository ppa:bamboo-engine/ibus-bamboo
sudo apt-get update
sudo apt-get install -y ibus ibus-bamboo ibus-mozc --install-recommends
ibus restart
env DCONF_PROFILE=ibus dconf write /desktop/ibus/general/preload-engines "['BambooUs', 'Bamboo', 'mozc-jp']" && gsettings set org.gnome.desktop.input-sources sources "[('xkb', 'us'), ('ibus', 'Bamboo'), ('ibus', 'mozc-jp')]"
  1. Open Neovim with the minimal config below
  2. In Neovim, enter insert mode, press to change to Vietnamese keyboard (the one with the symbol V. Then press ~ to change input method to 3, 5 or 6 (they are the only modes that work with Neovim's insert mode)
  3. Run Telescope, enter Insert mode and try typing xin.

Expected behavior

No response

Actual behavior

After you type the character n, it automatically change to normal mode. This never happens when I use insert mode in a normal buffer of Neovim.

I don't understand how insert mode in Telescope work, but it seems to have some difference from the insert mode of normal Neovim buffer that cause this error.

ibhagwan/fzf-lua use Terminal mode instead of insert mode for it, and I have never accounted any errors.

Minimal config

local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs { "config", "data", "state", "cache" } do
  vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.uv.fs_stat(lazypath) then
  vim.fn.system {
    "git",
    "clone",
    "--filter=blob:none",
    "https://github.com/folke/lazy.nvim.git",
    lazypath,
  }
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
  {
    "nvim-telescope/telescope.nvim",
    dependencies = {
      "nvim-lua/plenary.nvim",
    },
    config = function()
      -- ADD INIT.LUA SETTINGS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
      require("telescope").setup {}
    end,
  },
}

require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

vim.cmd[[
function! IBusOff()
	let g:ibus_prev_engine = trim(system('ibus engine'))
	execute 'silent !ibus engine xkb:us::eng'
endfunction

function! IBusOn()
	let l:current_engine = trim(system('ibus engine'))
	if l:current_engine !~? 'xkb:us::eng'
		let g:ibus_prev_engine = l:current_engine
	endif
	execute 'silent !' . 'ibus engine ' . g:ibus_prev_engine
endfunction

if executable('ibus')
	augroup IBusHandler
		autocmd CmdLineEnter [/?] call IBusOn()
		autocmd CmdLineLeave [/?] call IBusOff()
		autocmd InsertEnter * call IBusOn()
		autocmd InsertLeave * call IBusOff()
		autocmd ExitPre * call IBusOn()
	augroup END
	call IBusOff()
endif
]]
@brianhuster brianhuster added the bug Something isn't working label Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant