codi.vim icon indicating copy to clipboard operation
codi.vim copied to clipboard

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

Open jparoz opened this issue 8 years ago • 2 comments

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:

  • mvim foo.lua
  • Enter insert mode and type print(os.date())
  • Save (:w)
  • Start Codi (:Codi) Now Codi is updated whenever the cursor is moved, even though text hasn't changed.
  • Cause the buffer to be modified (on a new line: print("foo")) The frantic updating stops, and Codi now updates as expected, when text is changed.
  • Undo (u) The buffer is no longer 'modified', and erratic behaviour resumes.

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 [email protected]
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 

jparoz avatar Nov 30 '16 05:11 jparoz

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?

metakirby5 avatar Dec 02 '16 07:12 metakirby5

With vimrc:

filetype plugin indent on
syntax on
packloadall

and contents of .vim:

  • vimrc (no ~/.vimrc)
  • pack/jlp/start/codi.vim (directly cloned)

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

jparoz avatar Dec 03 '16 03:12 jparoz