instant-markdown / vim-instant-markdown

Instant Markdown previews from Vim
https://instant-markdown.github.io
Other
2.72k stars 249 forks source link

Incompatibility with goyo.vim #140

Open DenisLug opened 5 years ago

DenisLug commented 5 years ago

When I use instant-markdown with goyo.vim, I get strange characters at the top of the editor like these: ^[[2;2R^[[>65;5403;1c^[]10;rgb:ffff/ffff/ffff^[\^11;rgb:0000/0000/0000^[\

Also the preview stays often times blank. Is there a way to use instant-markdown together with goyo?

Regards Denis

MinhyukPark commented 5 years ago

Surprised to find this here as well. I've experienced issues where character buffer does not update properly in vim when using goyo.vim. I ended up uninstalling instant-markdown. It would be nice to see resolution to this problem.

ashwinvis commented 5 years ago

vim-instant-markdown simply sends lines to a node.js server, it does not write into vim. I use Goyo, but I cannot reproduce the issue. Can you share the plugins that you use and a screenshot?

MinhyukPark commented 5 years ago

Yeah I’ll get on that tomorrow. I didn’t do any kind of debugging or log checking when it happened so I might not be able to reproduce the issue.

MinhyukPark commented 5 years ago

ok I finally got some time to get to this.

after_goyo exit_goyo

It could be a Goyo issue as well but here is the best way I was able to localize the issue. When you type fast enough, the screenbuffer shows duplicate characters but when you exit Goyo everything is ok.

Feel free to ask me for anything extra or some testing you want me to do. I can't promise that I can get to them right away but I'm willing to help debug.

I'm on vim 8.1 with 1-1073 patches, compiled huge without gui. Just the default huge compile options. This happens on both vim, nvim, and both on ubuntu 18.04 and arch as far as I can tell.

When I was trying to reproduce this, the only plugins I was using were vundle, vim-monokai, and goyo.

ashwinvis commented 4 years ago

I use Goyo, but I don't get this. It seems unlikely that this issue relate to us. Keeping this open anyways, if someone has any hint.

Lilja commented 3 years ago

I also have this issue. I created this gif to show what I'm experiencing. Please excuse the quality. 2021-01-09 19-37-10 (,jo is how i enter goyo-mode)

This is Git bash on windows. Might be why I have issues.

ashwinvis commented 3 years ago

Thanks for taking that effort to screencap the issue. I tried to make a minimal.vimrc:

set nocompatible
filetype off

call plug#begin('~/.vim/plugged')
Plug 'junegunn/vim-plug'
Plug 'junegunn/goyo.vim', {'for': ['tex', 'text', 'markdown', 'markdown.pandoc', 'rst'], 'on': 'Goyo'}
Plug 'instant-markdown/vim-instant-markdown', {'for': ['markdown', 'markdown.pandoc']}
call plug#end()

filetype plugin indent on
syntax enable
set nomore
set noswapfile
set viminfo=

function! s:goyo_enter()
  silent !tmux set status off
  silent !tmux list-panes -F '\#F' | grep -q Z || tmux resize-pane -Z
  set noshowmode
  set noshowcmd
  set scrolloff=999
endfunction

function! s:goyo_leave()
  silent !tmux set status on
  silent !tmux list-panes -F '\#F' | grep -q Z && tmux resize-pane -Z
  set showmode
  set showcmd
  set scrolloff=5
endfunction

autocmd! User GoyoEnter nested call <SID>goyo_enter()
autocmd! User GoyoLeave nested call <SID>goyo_leave()

And I do not get this. I am using:

$ nvim --version
NVIM v0.4.4
Build type: Release
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/cc -g -O2 -fdebug-prefix-map=/build/neovim-Fc1Pxf/neovim-0.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=1 -DDISABLE_LOG -Wdate-time -D_FORTIFY_SOURCE=1 -O2 -DNDEBUG -DMIN_LOG_LEVEL=3 -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=always -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -I/build/neovim-Fc1Pxf/neovim-0.4.4/build/config -I/build/neovim-Fc1Pxf/neovim-0.4.4/src -I/usr/include -I/usr/include/lua5.1 -I/build/neovim-Fc1Pxf/neovim-0.4.4/build/src/nvim/auto -I/build/neovim-Fc1Pxf/neovim-0.4.4/build/include
Compiled by team+vim@tracker.debian.org

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info

Could you try to debug using the minimal vimrc and open it as follows, using vim / nvim:

$ nvim -u minimal.vimrc test.md
Lilja commented 3 years ago

Might be a problem with junegunn/limelight actually...

Try this vimrc:

set nocompatible
set t_Co=256 " Added this <----
filetype off

call plug#begin('~/.vim/plugged')
Plug 'junegunn/vim-plug'
Plug 'junegunn/limelight.vim' " Added this
Plug 'junegunn/goyo.vim', {'for': ['tex', 'text', 'markdown', 'markdown.pandoc', 'rst'], 'on': 'Goyo'}
Plug 'instant-markdown/vim-instant-markdown', {'for': ['markdown', 'markdown.pandoc']}
call plug#end()

filetype plugin indent on
syntax enable
set nomore
set noswapfile
set viminfo=

function! s:goyo_enter()
  silent !tmux set status off
  silent !tmux list-panes -F '\#F' | grep -q Z || tmux resize-pane -Z
  set noshowmode
  set noshowcmd
  set scrolloff=999
endfunction

function! s:goyo_leave()
  silent !tmux set status on
  silent !tmux list-panes -F '\#F' | grep -q Z && tmux resize-pane -Z
  set showmode
  set showcmd
  set scrolloff=5
endfunction

autocmd! User GoyoEnter nested call <SID>goyo_enter()
autocmd! User GoyoLeave nested call <SID>goyo_leave()

fun! ToggleJournal()
    " Color name (:help cterm-colors) or ANSI code
    let g:limelight_conceal_ctermfg = 100

    " Color name (:help gui-colors) or RGB color
    let g:limelight_conceal_guifg = '#83a598'

    execute 'Goyo'
    execute 'Limelight!!'
endfun

let g:mapleader = ","
:command! Journal :call ToggleJournal()
nnoremap <leader>jo :call ToggleJournal()<CR>

Added a function and some mappings. t_Co at the second line and then the vim-plug declaration for limelight.

ashwinvis commented 3 years ago

Tried that too. I cannot reproduce it. As you said it might be OS dependent. I am leaving it for someone interested to fix.