metakirby5 / codi.vim

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

When file is not modified, Codi updates on every cursor move #54

Open jparoz opened 7 years ago

jparoz commented 7 years ago

Issue description

When I'm using Codi while editing a Lua file in MacVim, if the file is not modified, Codi updates every time I move the cursor. This is in contrast to what happens when the file is modified, when Codi updates every time the text changes (when TextChanged or TextChangedI fires). As far as I can tell, this only happens with Lua files.

Steps to reproduce:

After modifing the buffer the first time after saving (here with print("foo")), Codi works as expected, even after saving again, until I use u to undo into a state where the buffer is not modified.

Other undesirable behaviours include syntax highlighting flickering off and on whenever Codi is erratically updating, and the undo history sometimes (seemingly randomly) being clobbered.

Environment

Running macOS Sierra (10.12.1) Last line of script manpage is BSD December 4 2013

The log file is over two thousand lines long, generated in about 30 seconds. Almost every keypress generates several log lines when this issue is happening, which may make the log hard to read.

Output of mvim --version:

VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Oct  9 2016 17:45:26)
MacOS X (unix) version
Included patches: 1-27
Compiled by travis@Traviss-Mac-592.local
Huge version with MacVim GUI.  Features included (+) or not (-):
+acl             +find_in_path    -mouse_sysmouse  -tag_any_white
+arabic          +float           +mouse_urxvt     -tcl
+autocmd         +folding         +mouse_xterm     +termguicolors
+balloon_eval    -footer          +multi_byte      +terminfo
+browse          +fork()          +multi_lang      +termresponse
++builtin_terms  +fullscreen      -mzscheme        +textobjects
+byte_offset     -gettext         +netbeans_intg   +timers
+channel         -hangul_input    +num64           +title
+cindent         +iconv           +odbeditor       +toolbar
+clientserver    +insert_expand   +packages        +transparency
+clipboard       +job             +path_extra      +user_commands
+cmdline_compl   +jumplist        +perl/dyn        +vertsplit
+cmdline_hist    +keymap          +persistent_undo +virtualedit
+cmdline_info    +lambda          +postscript      +visual
+comments        +langmap         +printer         +visualextra
+conceal         +libcall         +profile         +viminfo
+cryptv          +linebreak       +python/dyn      +vreplace
+cscope          +lispindent      +python3/dyn     +wildignore
+cursorbind      +listcmds        +quickfix        +wildmenu
+cursorshape     +localmap        +reltime         +windows
+dialog_con_gui  +lua/dyn         +rightleft       +writebackup
+diff            +menu            +ruby/dyn        -X11
+digraphs        +mksession       +scrollbind      -xfontset
+dnd             +modify_fname    +signs           +xim
-ebcdic          +mouse           +smartindent     -xpm
+emacs_tags      +mouseshape      +startuptime     -xsmp
+eval            +mouse_dec       +statusline      -xterm_clipboard
+ex_extra        -mouse_gpm       -sun_workshop    -xterm_save
+extra_search    -mouse_jsbterm   +syntax          
+farsi           +mouse_netterm   +tag_binary      
+file_in_path    +mouse_sgr       +tag_old_static  
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
  system gvimrc file: "$VIM/gvimrc"
    user gvimrc file: "$HOME/.gvimrc"
2nd user gvimrc file: "~/.vim/gvimrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
    system menu file: "$VIMRUNTIME/menu.vim"
  fall-back for $VIM: "/Applications/MacVim.app/Contents/Resources/vim"
Compilation: clang -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_MACVIM -Wall -Wno-unknown-pragmas -pipe  -DMACOS_X_UNIX  -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1      
Linking: clang   -L. -fstack-protector -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib  -L. -fstack-protector -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib   -L/usr/local/lib -o Vim -framework Cocoa -framework Carbon       -lm  -lncurses -liconv -framework Cocoa   -fstack-protector  -L/System/Library/Perl/5.16/darwin-thread-multi-2level/CORE 
metakirby5 commented 7 years ago

Can't seem to reproduce with same macOS, script, and mvim versions 😖 Does this occur with a minimal .vimrc as well, i.e. taking everything out except for a plugin manager + Codi?

jparoz commented 7 years ago

With vimrc:

filetype plugin indent on
syntax on
packloadall

and contents of .vim:

I'm still getting the described behaviour. Are there any dependencies I'm not thinking of, or anything else I could have configured differently?