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

A << mapping does not work #160

Closed
lambdalisue opened this issue Jul 20, 2016 · 2 comments
Closed

A << mapping does not work #160

lambdalisue opened this issue Jul 20, 2016 · 2 comments

Comments

@lambdalisue
Copy link
Contributor

lambdalisue commented Jul 20, 2016

function! s:test()
  echo "Hello"
endfunction

nmap <silent><nowait> << :<C-u>call <SID>test()<CR>
nmap <silent><nowait> >> :<C-u>call <SID>test()<CR>

source the vim script file above define << and >> mapping but << mapping seems not work only on neovim-qt (works on vim/GVim/nvim but neovim-qt).

I confirmed that << is mapping to s:test() correctly by :nmap.

selection_001

I'm not really sure if it is my environment issue or bug. Could you try with the script above?

@equalsraf
Copy link
Owner

The script works here, but maybe this is the same issue as #134, where < gets translates into the wrong key. Can you try adding the following debug line to see what is being passed onto neovim.

diff --git a/src/gui/shell.cpp b/src/gui/shell.cpp
index a2e5096..1c771be 100644
--- a/src/gui/shell.cpp
+++ b/src/gui/shell.cpp
@@ -567,6 +567,7 @@ void Shell::keyPressEvent(QKeyEvent *ev)
                return;
        }

+       qDebug() << ev->text() << ev->key() << ev->modifiers() << inp;
        m_nvim->neovimObject()->vim_input(m_nvim->encode(inp));
        // FIXME: bytes might not be written, and need to be buffered
 }

@lambdalisue
Copy link
Contributor Author

"<" 60 QFlags<Qt::KeyboardModifiers>(ShiftModifier) "<S-lt>"
"<" 60 QFlags<Qt::KeyboardModifiers>(ShiftModifier) "<S-lt>"

I close this and write additional informations to #134 while it seems same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants