gelguy / Cmd2.vim

cmdline-mode enhancement for Vim
MIT License
94 stars 4 forks source link

Not showing messages #6

Closed alem0lars closed 9 years ago

alem0lars commented 9 years ago

When the plugin Cmd2 is active and I type :messages, the messages aren't shown.

gelguy commented 9 years ago

I am unable to replicate this.

alem0lars commented 9 years ago

If you type :messages can you read them?

gelguy commented 9 years ago

Yes, the messages appear as per normal.

alem0lars commented 9 years ago

Here is the behaviour: asciicast

gelguy commented 9 years ago

The :intro splashscreen is not included in :messages, and newer versions of Vim do not have the messages maintainer message.

Could you try again after creating a message (e.g. opening a file)?

alem0lars commented 9 years ago

asciicast

gelguy commented 9 years ago

Do you happen to have a map or cmap for <CR>?

I am unable to figure out what might be causing the :messages to not show as the other commands seem to be working fine.

If you can create a minimal .vimrc (i.e. .vimrc with only Vundle and Cmd2.vim) which can replicate this issue I can do further troubleshooting.

alem0lars commented 9 years ago

Do you happen to have a map or cmap for ?

No


This problem seems to be more general, since it seems that some commands sometimes are "not taken". This also explains :messages not showing output: it's because the command is not taken.

Details here: asciicast

gelguy commented 9 years ago

I can replicate this when loop_sleep is set to more than zero, i.e. the default value.

Can you confirm that this does not occur when loop_sleep is set to 0?

alem0lars commented 9 years ago

I'm having that problem with the following Cmd2 configuration:

" {{{ Options.

let g:Cmd2_cmd_mappings = {
      \ 'iw': {'command': 'iw', 'type': 'text', 'flags': 'Cpv'},
      \ 'ap': {'command': 'ap', 'type': 'line', 'flags': 'pv'},
      \ '^': {'command': '^', 'type': 'normal!', 'flags': 'r'},
      \ 'w': {'command': 'Cmd2#functions#Cword',
          \ 'type': 'function', 'flags': 'Cr'},
      \ }

let g:Cmd2_options = {
      \   '_complete_ignorecase': 1,
      \   '_complete_uniq_ignorecase': 0,
      \   '_quicksearch_ignorecase': 1,
      \   '_complete_start_pattern': '\<\(\k\+\(_\|\#\)\)\?',
      \   '_complete_fuzzy': 1,
      \   '_suggest_render': 'Cmd2#render#New().WithInsertCursor().WithAirlineMenu()',
      \   'loop_sleep': 0,
      \   'menu_hl': 'airline_x',
      \   'menu_selected_hl': 'airline_y',
      \   'menu_separator_hl': 'airline_x',
      \ }

if exists('g:Cmd2_default_options')
  call Cmd2#init#Options(g:Cmd2_default_options)
endif

" Character to type to start wildcard expansion in the command-line.
set wildcharm=<Tab>

" }}}

" {{{ Configure hotkeys.

" : or /: Enable Cmd2 automatically.
nmap <expr> : ':' . (&paste ? '' : "\<Plug>(Cmd2Suggest)")
nmap <expr> / '/' . (&paste ? '' : "\<Plug>(Cmd2Suggest)")

" <F11>: Enable Cmd2 manually.
cmap <F11> <Plug>(Cmd2Suggest)

" <Tab>: Perform completion using Cmd2.
cmap <expr> <Tab> Cmd2#ext#complete#InContext() ?
      \ '\<Plug>(Cmd2Complete)' :
      \ '\<Tab>'

" }}}
gelguy commented 9 years ago

I am unable to replicate it with that configuration.

Can you produce a minimal .vimrc which can reproduce the issue? i.e. no other plugins and mappings.

Example:

set nocp
filetype off
set rtp+=~/.vim/bundle/Cmd2.vim      " your Cmd2 path here
filetype plugin indent on

let g:Cmd2_options = {
        \ 'loop_sleep': 0,
        \ }

nmap / /<F11>
cmap <F11> <Plug>(Cmd2Suggest)

Are you also using key settings for urxvt?

alem0lars commented 9 years ago

Are you also using key settings for urxvt?

Yes

This is my Xdefaults configuration:

! {{{ Xft

Xft.antialias: true
Xft.autohint:  true
Xft.hinting:   true
Xft.hintstyle: hintfull
Xft.lcdfilter: lcddefault
Xft.rgba:      rgb

! }}}

! {{{ Colors

#include "/etc/X11/xinit/Xresources.d/colorschemes/jellybeans.xresources"

! }}}

! {{{ Cross-terminal settings.

*saveLines:    65536
*cursorBlink:  false
*bellIsUrgent: true

! }}}

! {{{ XTerm.

xterm*faceName:          xft:DejaVu\ Sans\ Mono\ for\ Powerline:size=11
xterm*utf8:              2
xterm*colorMode:         true
xterm*dynamicColors:     true
xterm*scrollTtyKeypress: true
xterm*scrollTtyOutput:   false
xterm*rightScrollBar:    true
xterm*jumpScroll:        true
xterm*multiScroll:       true
xterm*selectToClipboard: true
xterm*toolBar:           false

! }}}

! {{{ URXVT.

! terminal info
urxvt*termName:       rxvt-256color
urxvt*iso14755_52:    false
urxvt.matcher.button: 1
urxvt.cutchars:       ()*,<>[]{}|`""''

urxvt.underlineURLs: true

! pseudo-transparency
urxvt*shading:     50
urxvt*transparent: false

! font
urxvt*font:           xft:DejaVu\ Sans\ Mono\ for\ Powerline:size=11
urxvt*boldFont:       xft:DejaVu\ Sans\ Mono\ for\ Powerline:size=11
urxvt*italicFont:     xft:DejaVu\ Sans\ Mono\ for\ Powerline:size=11
urxvt*boldItalicFont: xft:DejaVu\ Sans\ Mono\ for\ Powerline:size=11

! scrollbar
urxvt.scrollBar: false

! extensions
urxvt.perl-ext-common: default,clipboard,matcher,keyboard-select,url-select

! keys mapping
urxvt.keysym.Home:        \033[H
urxvt.keysym.End:         \033[F
urxvt.keysym.S-Up:        \033[1;2A
urxvt.keysym.S-Down:      \033[1;2B
urxvt.keysym.S-Right:     \033[1;2C
urxvt.keysym.S-Left:      \033[1;2D
urxvt.keysym.S-Home:      \033[1;2H
urxvt.keysym.S-End:       \033[1;2F
urxvt.keysym.M-Up:        \033[1;3A
urxvt.keysym.M-Down:      \033[1;3B
urxvt.keysym.M-Right:     \033[1;3C
urxvt.keysym.M-Left:      \033[1;3D
urxvt.keysym.M-Page_Up:   \033[5;3~
urxvt.keysym.M-Page_Down: \033[6;3~
urxvt.keysym.M-Home:      \033[1;3H
urxvt.keysym.M-End:       \033[1;3F
urxvt.keysym.M-S-Up:      \033[1;4A
urxvt.keysym.M-S-Down:    \033[1;4B
urxvt.keysym.M-S-Right:   \033[1;4C
urxvt.keysym.M-S-Left:    \033[1;4D
urxvt.keysym.M-S-Home:    \033[1;4H
urxvt.keysym.M-S-End:     \033[1;4F
urxvt.keysym.C-Up:        \033[1;5A
urxvt.keysym.C-Down:      \033[1;5B
urxvt.keysym.C-Right:     \033[1;5C
urxvt.keysym.C-Left:      \033[1;5D

! clipboard
urxvt.keysym.M-c:         perl:clipboard:copy
urxvt.keysym.M-v:         perl:clipboard:paste
urxvt.keysym.M-C-v:       perl:clipboard:paste_escaped
urxvt.clipboard.copycmd:  xclip -i -selection clipboard
urxvt.clipboard.pastecmd: xclip -o -selection clipboard

! keyboard-select
urxvt.keysym.M-Escape: perl:keyboard-select:activate
urxvt.keysym.M-s:      perl:keyboard-select:search

! url-select
urxvt.keysym.M-u:  perl:url-select:select_next
urxvt.urlLauncher: /usr/bin/firefox

urxvt.url-select.launcher:  /usr/bin/firefox
urxvt.url-select.underline: true
urxvt.url-select.button:    1
urxvt.url-select.autocopy:  false

! }}}

Do you think this can cause the problem?

gelguy commented 9 years ago

I am still unable to reproduce this in urxvt on Ubuntu with those settings.

Does this occur using another terminal emulator e.g. gnome-terminal?

alem0lars commented 9 years ago

No.

This is my configuration: http://s000.tinyupload.com/?file_id=06557182741859183912

gelguy commented 9 years ago

Please provide a minimal .vimrc which can reproduce this issue as opposed to your entire configuration.

As mentioned above, an example is:

set nocp
filetype off
set rtp+=~/.vim/bundle/Cmd2.vim      " your Cmd2 path here
filetype plugin indent on

let g:Cmd2_options = {
        \ 'loop_sleep': 0,
        \ }

nmap / /<F11>
cmap <F11> <Plug>(Cmd2Suggest)
gelguy commented 9 years ago

Can you get the keycodes for the following keys using

:echo getchar()

Keys: Enter, Shift-Enter, Ctrl-Enter and Ctrl-j

alem0lars commented 9 years ago

Enter: 13 Shift-Enter: 13 Ctrl-Enter: 13 Ctrl-j: 10

gelguy commented 9 years ago

The keycodes are correct so it should not be a terminal setting issue.

The only idea I have left is that there is a cmap for <CR> which can be checked with verbose cmap <CR>.

Otherwise there might be another plugin interfering. This is why a minimal .vimrc is needed to troubleshoot. For a quick check you can comment out all the other plugins in your NeoBundle configuration and see if the bug still occurs. If so, then there is not plugin interfering. If it doesnt occur, then you can perform a binary search to see which plugin is causing the issue.

alem0lars commented 9 years ago

mmm..

:verbose cmap <CR> gives me:

c  <CR>        & <SNR>98__trigger_or_fallback("\<Enter>", "\<Return>")
        Last set from /etc/vim/bundle/vim-smartinput/autoload/smartinput.vim
gelguy commented 9 years ago

Issue is reproduced when using vim-smartinput.

Temporary fix at 15ead9c9aa54fbe50b9458878c53f9908b588483 on master.

The behaviour to drop the completion when handling cmaps was intentional, but now it does seem to do more harm than good.

Proper cmap handling will be done in a future version.

alem0lars commented 9 years ago

Wow, thanks.

I can confirm this is the issue and without the smartinput plugin it correctly works.

Also, if the plugin is updated to latest commit, it works with the smartinput plugin.

Thanks very much. Your support is (as always) Awesome!