metakirby5 / codi.vim

:notebook_with_decorative_cover: The interactive scratchpad for hackers.
MIT License
3.02k stars 83 forks source link

Codi doesn't work with other plugins that use extmark. #142

Closed rhcher closed 2 years ago

rhcher commented 2 years ago

Issue description

if &compatible set nocompatible endif

let s:plug_dir = expand('/tmp/plugged/vim-plug') if !filereadable(s:plug_dir .. '/plug.vim') execute printf('!curl -fLo %s/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim', s:plug_dir) end

execute 'set runtimepath+=' . s:plug_dir call plug#begin(s:plug_dir) Plug 'dcampos/nvim-snippy' Plug 'honza/vim-snippets' Plug 'metakirby5/codi.vim' call plug#end() PlugInstall | quit

imap snippy#can_expand_or_advance() ? '(snippy-expand-or-advance)' : '' imap snippy#can_jump(-1) ? '(snippy-previous)' : '' smap snippy#can_jump(1) ? '(snippy-next)' : '' smap snippy#can_jump(-1) ? '(snippy-previous)' : '' xmap (snippy-cut-text)

lua << EOF require('snippy').setup({ hl_group = 'Search', }) EOF

- Exact steps to reproduce the issue, starting with the command used to open
  `vim`
  1. `nvim -u mini.vim test.py`
  2. run command `:Codi`
  3. input `def` and press `tab` to expand snippet, then input random, the error message pop up
- Any relevant screenshots
![image](https://user-images.githubusercontent.com/50723480/150717885-bfe999dc-eae0-4487-80c8-0f64162424ae.png)
- If it's not too much trouble, a screencast (e.g. asciinema) of the issue

## Environment
- Operating system
wsl2 Arch
- Version of `script` (if you don't know, just paste the last line of the
  man page)
- The following **in a pastebin**, to reduce visual clutter:
  - Entire output of `nvim --version`

NVIM v0.7.0-dev+920-g7e2ce35e3b


  - Log lines (see `:h g:codi#log`)
metakirby5 commented 2 years ago

I don't have the bandwidth to make a fix right now, but if someone can try the proposed fix, run some tests, and submit a pull request, I'm happy to review!

JoseConseco commented 2 years ago

I think this https://github.com/metakirby5/codi.vim/pull/151 PR should fix the issue.