Giter Site home page Giter Site logo

"No mappings found" error about vim-xkbswitch HOT 18 CLOSED

zdm avatar zdm commented on May 28, 2024
"No mappings found" error

from vim-xkbswitch.

Comments (18)

zdm avatar zdm commented on May 28, 2024 1

from vim-xkbswitch.

lyokha avatar lyokha commented on May 28, 2024

Hi, can you show output of command :imap?

from vim-xkbswitch.

lyokha avatar lyokha commented on May 28, 2024

Can you apply this patch:

--- xkbswitch.vim	2017-02-17 16:33:48.136597910 +0300
+++ /home/lyokha/.vim/plugin/xkbswitch.vim	2017-02-20 14:59:49.022244175 +0300
@@ -323,7 +323,9 @@
     redir => mappingsdump
     silent imap
     redir END
-    let mappings = split(mappingsdump, '\n')
+    let ff = empty(&ffs) ? &ff : split(&ffs, ',')[0]
+    let eol = ff == 'dos' ? '\r\n' : (ff == 'mac' ? '\r' : '\n')
+    let mappings = split(mappingsdump, eol)
     let mappingskeys = {}
     for mapping in mappings
         let mappingskeys[split(mapping)[1]] = 1

and test again? And show what is your :imap prints out?

from vim-xkbswitch.

zdm avatar zdm commented on May 28, 2024

from vim-xkbswitch.

lyokha avatar lyokha commented on May 28, 2024

Looks good at first glance, except for

<C-R>и *@<C-R>b

Here there is no i at the beginning, but i suspect that you just missed it when copied and pasted the output, correct?

from vim-xkbswitch.

zdm avatar zdm commented on May 28, 2024

from vim-xkbswitch.

lyokha avatar lyokha commented on May 28, 2024

Please comment let g:XkbSwitchIMappings = ['ru'] in your .vimrc and run vim again, does it help?

from vim-xkbswitch.

zdm avatar zdm commented on May 28, 2024

from vim-xkbswitch.

lyokha avatar lyokha commented on May 28, 2024

ok, then the reason is in IMappings, then i need to carefully read through all your imap's and find what kind of them the plugin does not parse well.

from vim-xkbswitch.

zdm avatar zdm commented on May 28, 2024

from vim-xkbswitch.

lyokha avatar lyokha commented on May 28, 2024

Yes, could you again disable let g:XkbSwitchIMappings = ['ru'] and show how looks output of :imap in this case (it must be shorter).

from vim-xkbswitch.

zdm avatar zdm commented on May 28, 2024

from vim-xkbswitch.

lyokha avatar lyokha commented on May 28, 2024

I do not see any issues with imap translation, actually it works fine. Probably you have some wrong definitions of imaps in you .vimrc (see related solution here). Actually vim-xkbswitch calls command imap when it translates IMappings: it makes it using Vim's command redir which itself is not safe though. But it do it only once whereas you have multiple lines of the No mapping found message, and this is really strange.

from vim-xkbswitch.

zdm avatar zdm commented on May 28, 2024

from vim-xkbswitch.

lyokha avatar lyokha commented on May 28, 2024

Please try the next patch:

--- plugin/xkbswitch.vim	2017-02-20 21:32:22.476482300 +0300
+++ /home/lyokha/.vim/plugin/xkbswitch.vim	2017-02-20 22:13:26.640931328 +0300
@@ -340,6 +340,19 @@
                 continue
             endif
             let data = split(mapping)
+            if data[0] != 'i' || len(data) < 3
+                    echoerr "Line '".mapping."' does not look like an imap ".
+                                \ "value, another plugin is supposedly ".
+                                \ "doing 'redir'!"
+                continue
+            endif
+            let mapval = maparg(data[1], 'i')
+            if empty(mapval)
+                    echoerr "Line '".mapping."' does not look like an imap ".
+                                \ "value, another plugin is supposedly ".
+                                \ "doing 'redir'!"
+                continue
+            endif
             " do not duplicate <Plug> and <SNR> mappings
             " (when key starts with '<Plug>' or '<SNR>')
             if match(data[1], '^\c\%(<Plug>\|<SNR>\)') != -1

I wonder if you'll see messages about parallel redir.

from vim-xkbswitch.

lyokha avatar lyokha commented on May 28, 2024

Please try the new version, now it won't complain (because referring to redir was erroneous) and check by :imap that all your maps got translated (including <ce>u -> <ce>г and <ce>w -> <ce>ц). If everything is OK then we can close the bug.

from vim-xkbswitch.

zdm avatar zdm commented on May 28, 2024

from vim-xkbswitch.

lyokha avatar lyokha commented on May 28, 2024

Thanks for cooperation!

from vim-xkbswitch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.