m4xshen / autoclose.nvim

A minimalist Neovim plugin that auto pairs & closes brackets
MIT License
488 stars 13 forks source link

Doesn't respect language layout #51

Closed va9abond closed 7 months ago

va9abond commented 7 months ago

Intro

Hello, I love the simplicity of your plugin, thanks man

Module(s)

m4xshen/autoclose.nvim, lyokha/vim-xkbswitch

Description

Error that I get:

E15: Invalid expression: <Lua 174: path/to/file.lua:157>

Neovim version

0.9.4

Steps to reproduce

minimal reproducing config

Using folke/lazy.nvim to manage plugins.

Expected behavior

file.* and active Russian keyboard layout:

Before        Input         After
------------------------------------
Лорем |         х          Лорем х
Лорем |         э          Лорем э
------------------------------------

Actual behavior

file.* and active Russian keyboard layout:

Before        Input         After
------------------------------------
Лорем |         х          Лорем *ERROR*
Лорем |         э          Лорем *ERROR*
------------------------------------
telemachus commented 7 months ago

I don't know anything about the keyboard switching plugin, but I wonder whether this is related to autoclose not supporting multibyte characters.

Just in case, I maintain a fork that supports multibyte characters (currently only for insert mode, though I have code for command mode as well). Just to rule that out, maybe try my fork (the main branch there) and see if it works any better?

https://github.com/telemachus/autoclose.nvim

va9abond commented 7 months ago

Thanks a lot for the reply. I tried your fork, but it didn't work for me.

So, I decided to remove the xkb-switch plugin and both m4xshen/autopairs and telemachus/autopairs fork started working perfectly with tuned vim.opt.langmap except leader key which in my case is ;, but this is a vim issue and autopair plugin shouldn't try to solve this problem.