Giter Site home page Giter Site logo

Comments (30)

lyokha avatar lyokha commented on May 28, 2024

This is already in as you described. How do you switch modes?

from vim-xkbswitch.

zdm avatar zdm commented on May 28, 2024

I use gvim under windows.

I select text with cursor keys and SHIFT pressed. Vim automatically
switch to SELECT mode.

On 31.07.2014 12:03, Alexey Radkov wrote:

This is already in as you described. How do you switch modes?


Reply to this email directly or view it on GitHub
#12 (comment).

from vim-xkbswitch.

zdm avatar zdm commented on May 28, 2024

screen

As you can see at screen cast:

  1. after i select text, i switch layout to RU and start typing;
  2. first character entered in RU layout, as expected;
  3. but all others entered in EN, because vim automatically switch layout to EN;

from vim-xkbswitch.

lyokha avatar lyokha commented on May 28, 2024

Yes, i remember that problem and it is reproducible. I will try to fix it but i remember that it is hard because when you just entered Select mode and then switched layout without typing text there is no hook in vim to catch this event because there is no SelectEnter (like existing InsertEnter).

from vim-xkbswitch.

zdm avatar zdm commented on May 28, 2024

Why do not simply logically combine SELECT and INSERT modes and don't try to switch layouts between them?

I understand, you capture current layout using using vim events, and select mode doesn't generate any needed events.

from vim-xkbswitch.

lyokha avatar lyokha commented on May 28, 2024

I do combine Select and Insert mode: they work as a whole. For example enter Insert mode, change layout to Russian, exit it and enter Select mode, then start typing: you will get Russian and vice versa works too: this bug just proves this! It switches layout to which was set on the second character typed! What you see is vim's discrepancy about Select mode to Insert mode transfer. Actually when the first character is inserted in Select mode we are still in some Mode-Limbo: this is nor Insert mode yet neither Select mode.

from vim-xkbswitch.

zdm avatar zdm commented on May 28, 2024

So, there is no way to detect layout switching in select mode?

On 31.07.2014 13:25, Alexey Radkov wrote:

I do combine Select and Insert mode: they work as a whole. For example
enter Insert mode, change layout to Russian, exit it and enter Select
mode, then start typing: you will get Russian and vice versa works
too: this bug just proves this! It switches layout to which was set on
the second character typed! What you see is vim's discrepancy about
Select mode to Insert mode transfer. Actually when the first character
is inserted in Select mode we are still in some Mode-Limbo: this is
nor Insert mode yet neither Select mode.


Reply to this email directly or view it on GitHub
#12 (comment).

from vim-xkbswitch.

lyokha avatar lyokha commented on May 28, 2024

Did you set g:XkbSwitchLoadOnBufRead im .vimrc?

from vim-xkbswitch.

zdm avatar zdm commented on May 28, 2024

No.
Does this option can help?

from vim-xkbswitch.

lyokha avatar lyokha commented on May 28, 2024

No. If you would have set it to 0 then it could explain such behaviour in very rare cases.

What says your

:echo &selectmode

and

:smap <LeftRelease>

? Second command must output someting with command xkb_switch(1, 1).

from vim-xkbswitch.

lyokha avatar lyokha commented on May 28, 2024

Ok, i see what the reason of the problem is. You are using selectmode=key. It is not currently supported in the plugin, only selectmode= and selectmode=mouse (start Select mode by mouse) are supported. I will think about fixing it as an enhancement.

from vim-xkbswitch.

lyokha avatar lyokha commented on May 28, 2024

Please try the fix: should work

from vim-xkbswitch.

zdm avatar zdm commented on May 28, 2024

No, the behavior wasn't changed.

from vim-xkbswitch.

lyokha avatar lyokha commented on May 28, 2024

What is your selectmode and keymodel options? What shows command

:nmap <S-Right>

?

from vim-xkbswitch.

zdm avatar zdm commented on May 28, 2024

n *@call 54_xkb_switch(1,1)

On 31.07.2014 17:14, Alexey Radkov wrote:

nmap

from vim-xkbswitch.

lyokha avatar lyokha commented on May 28, 2024

Correct. Shift-Right must work. Do you use Shift-Right? Or other keystrokes?

from vim-xkbswitch.

zdm avatar zdm commented on May 28, 2024

Exactly S-Right.

On 31.07.2014 17:31, Alexey Radkov wrote:

Correct. Shift-Right must work. Do you use Shift-Right? Or other
keystrokes?


Reply to this email directly or view it on GitHub
#12 (comment).

from vim-xkbswitch.

lyokha avatar lyokha commented on May 28, 2024

I am using vim on Linux. The behaviour before the fix was the same as you described. After the fix it behaves well. Unfortunately i cannot test it on Windows.

from vim-xkbswitch.

zdm avatar zdm commented on May 28, 2024

Later i can look at your fix and try to adopt it for windows, if it
possible.

On 31.07.2014 17:39, Alexey Radkov wrote:

I am using vim on Linux. The behaviour before the fix was the same as
you described. After the fix it behaves well. Unfortunately i cannot
test it on Windows.


Reply to this email directly or view it on GitHub
#12 (comment).

from vim-xkbswitch.

lyokha avatar lyokha commented on May 28, 2024

Ok, but i really can't get the reason of difference between Linux and Windows implementations, except Windows one has 'local' setting (i.e. layout switching affect only current window whereas Linux implementation is 'global'), but this should not affect here and i tried to switch this setting to 'local' to test it and it worked too.

from vim-xkbswitch.

lyokha avatar lyokha commented on May 28, 2024

Ah, did you start Select mode from Normal or Insert mode?

from vim-xkbswitch.

zdm avatar zdm commented on May 28, 2024

If I start select from NORMAL mode - it works, from INSERT - no.

On 31.07.2014 17:55, Alexey Radkov wrote:

Ah, did you start Select mode from Normal or Insert mode?


Reply to this email directly or view it on GitHub
#12 (comment).

from vim-xkbswitch.

zdm avatar zdm commented on May 28, 2024

It works as expected if I enter SELECT mode from NORMAL mode.
But old invalid behavior remaining if I enter SELECT mode from INSERT mode.

from vim-xkbswitch.

lyokha avatar lyokha commented on May 28, 2024

Try this fix, should work for selections in Insert mode. Btw you may notice fast unnecessary switching of layouts when doing selections from Insert modes: see comments in the patch for details why it happens.

from vim-xkbswitch.

zdm avatar zdm commented on May 28, 2024

Yes, now works as it should.
Thank you.

from vim-xkbswitch.

zdm avatar zdm commented on May 28, 2024

One thing.
You intercept S+Arrow key to detect entering in SELECT mode?
This not works if I select text with Ctrl + Shift + Left, for example.
Maybe more common approach needed to detect SELECT mode?

from vim-xkbswitch.

zdm avatar zdm commented on May 28, 2024

As i see, only S+Right and S + Down works,
Also needed to hook S + Left and S + Up combinations.

from vim-xkbswitch.

lyokha avatar lyokha commented on May 28, 2024

Do not work for specific key combinations? This is extremely strange because the plugin does not distinguish between them, instead it just creates mappings for each S-key element from a list. Maybe some desktop level key-bindings driven issue?

Btw in latest commit I introduced a new variable g:XkbSwitchSelectmodeKeys where you can put custom Select mode start key bindings (but i do not believe that such customization may be of any use). Default value is

    let g:XkbSwitchSelectmodeKeys =
                \ ['<S-Left>', '<S-Right>', '<S-Up>', '<S-Down>', '<S-End>',
                \  '<S-Home>', '<S-PageUp>', '<S-PageDown>']

from vim-xkbswitch.

lyokha avatar lyokha commented on May 28, 2024

Please try Shift-Ctrl keys: must work now. If everything is Ok then i'll close the issue.

from vim-xkbswitch.

zdm avatar zdm commented on May 28, 2024

Seems everything fine.
Thanks.

On 01.08.2014 22:06, Alexey Radkov wrote:

Please try Shift-Ctrl keys: must work now. If everything is Ok then
i'll close the issue.


Reply to this email directly or view it on GitHub
#12 (comment).

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.