TaDaa / vimade

An eye friendly plugin that fades your inactive buffers and preserves your syntax highlighting!
MIT License
486 stars 8 forks source link

Vimade causes <CR> to evaluate to <C-j> for some reason #18

Closed riv20 closed 5 years ago

riv20 commented 5 years ago

I have reason to believe that Vimade interferes with the <CR> key in normal mode.

Indeed, given the following .vimrc file:

call plug#begin()
Plug 'https://github.com/TaDaa/vimade'
call plug#end()

nnoremap <CR> ciw

then using <CR> in normal mode does not yield the expected results. In fact, what is happening is that <CR> is for some reason being evaluated to <C-j>. Indeed, if I add the additional line:

nnoremap <C-j> iSpooky!<Esc>

then surely enough, entering <CR> in normal mode causes the word Spooky! to be inserted into the buffer.

Of course, this behaviour disappears when I don't load Vimade. Note also that in Neovim I have not encountered this issue.

I'm using a Homebrew installation of Vim, version 8.1.1300. If it helps, the output of VimadeInfo is the following:

{"version":"0.0.5","python":{"original_background":"dark","normalnc_id":"","base_fg":[235,219,178],"base_fg_last":[235,219,178],"termguicolors":0,"signs_retention_period":4000,"t
erm_response":1,"base_hi":[[235,219,178],[39,39,39]],"normal_bg":"","hi_fg":" ctermfg=","background":"dark","ENABLE_SIGNS":8,"col_buf_size":15,"hi_bg":" ctermbg=","term_bg":[39,3
9,39],"is_nvim":0,"row_buf_size":15,"normal_id":"0","base_bg_exp":"16","base_bg":[39,39,39],"DISABLE_SIGNS":16,"base_fade":"101","fade_level":0.4,"colorscheme":"\ndefault","is_te
rm":1,"is_tmux":0,"enable_signs":0,"term_fg":[235,219,178],"base_bg_last":[39,39,39],"base_fg_exp":"231"},"other":{"background":"dark","normal_hi":["",""],"vimade_py_cmd":"py3","
has_gui":0,"has_python":0,"vimade_timer":1,"has_gui_running":0,"vimade_error_count":0,"syntax":"","has_nvim":0,"normal_id":0,"vimade_running":1,"colorscheme":"\ndefault","t_Co":"
256","vimade_loaded":1,"has_python3":1},"config":{"basebg":"","enablesigns":0,"basefg":"","detecttermcolors":1,"normalid":0,"normalncid":"","fadelevel":0.4,"rowbufsize":15,"colbu
fsize":15,"signsretentionperiod":4000,"$extended":1,"usecursorhold":0,"checkinterval":100}}

Many thanks

TaDaa commented 5 years ago

Thank you for the detailed debug! colors.sh seems to be interfering with the first buffer. New buffers appear to work ok, but it's not ideal. I'll work through this, in the mean time the behavior can be disabled (if you don't use custom terminal backgrounds) by using :

let g:vimade = {}
let g:vimade.detecttermcolors=0

If you are using custom terminal backgrounds, creating a new buffer and destroying the initial one should work as well

riv20 commented 5 years ago

Thanks for your reply. Setting let g:vimade.detecttermcolors=0 did indeed fix the issue for me.

TaDaa commented 5 years ago

Should be fixed, feel free to re-open if the latest doesn't fix this issue for you

riv20 commented 5 years ago

Fantastic, thanks for taking the time to do this