Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vim-over gets invoked in insert-mode #34

Open
fredrikhl opened this issue Aug 21, 2014 · 9 comments
Open

vim-over gets invoked in insert-mode #34

fredrikhl opened this issue Aug 21, 2014 · 9 comments

Comments

@fredrikhl
Copy link

It seems vim-over starts matching in insert-mode. This can get really annoying when writing plaintext documents. Every time a word ends with an 's', and is followed by a comma, vim starts matching the following word. When this happens, certain key combinations will also start acting weird, inserting text like <Plug>(over-cmdline-something) in the buffer.

example_1

example_2

@osyo-manga
Copy link
Owner

Thanks for issues.
Please tell me how to reproduce.

@fredrikhl
Copy link
Author

As in the examples:

Start vim without any arguments. Enter insert-mode, and type a word that ends with 's' followed by a separator (e.g. comma or slash). Any text followed will be highlighed and matched.

Also, if you then exit to normal mode, and press Shift + A quickly, you'll insert <Plug>(over-restore-search-pattern) into the buffer.

@fredrikhl
Copy link
Author

I'm loading vim-over with pathogen, no settings in vim-over has been altered.

 ~ $ vim --version
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Feb 15 2014 12:09:00)
Included patches: 1-179
Modified by <bugzilla@redhat.com>
Compiled by <bugzilla@redhat.com>
Huge version without GUI.  Features included (+) or not (-):
+acl             +farsi           +mouse_netterm   +syntax
+arabic          +file_in_path    +mouse_sgr       +tag_binary
+autocmd         +find_in_path    -mouse_sysmouse  +tag_old_static
-balloon_eval    +float           +mouse_urxvt     -tag_any_white
-browse          +folding         +mouse_xterm     -tcl
++builtin_terms  -footer          +multi_byte      +terminfo
+byte_offset     +fork()          +multi_lang      +termresponse
+cindent         +gettext         -mzscheme        +textobjects
-clientserver    -hangul_input    +netbeans_intg   +title
-clipboard       +iconv           +path_extra      -toolbar
+cmdline_compl   +insert_expand   +perl            +user_commands
+cmdline_hist    +jumplist        +persistent_undo +vertsplit
+cmdline_info    +keymap          +postscript      +virtualedit
+comments        +langmap         +printer         +visual
+conceal         +libcall         +profile         +visualextra
+cryptv          +linebreak       +python/dyn      +viminfo
+cscope          +lispindent      -python3         +vreplace
+cursorbind      +listcmds        +quickfix        +wildignore
+cursorshape     +localmap        +reltime         +wildmenu
+dialog_con      -lua             +rightleft       +windows
+diff            +menu            +ruby/dyn        +writebackup
+digraphs        +mksession       +scrollbind      -X11
-dnd             +modify_fname    +signs           -xfontset
-ebcdic          +mouse           +smartindent     -xim
+emacs_tags      -mouseshape      -sniff           -xsmp
+eval            +mouse_dec       +startuptime     -xterm_clipboard
+ex_extra        +mouse_gpm       +statusline      -xterm_save
+extra_search    -mouse_jsbterm   -sun_workshop    -xpm
   system vimrc file: "/etc/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
  fall-back for $VIM: "/etc"
 f-b for $VIMRUNTIME: "/usr/share/vim/vim74"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H     -O2 -g -pipe -Wall -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches  -m64 -mtune=generic -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1      
Linking: gcc   -L. -Wl,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic -Wl,--enable-new-dtags  -Wl,-z,relro  -L/usr/local/lib -Wl,--as-needed -o vim        -lm -lnsl  -lselinux  -lncurses -lacl -lattr -lgpm -ldl   -Wl,--enable-new-dtags  -fstack-protector  -L/usr/lib64/perl5/CORE -lperl -lresolv -lnsl -ldl -lm -lcrypt -lutil -lpthread -lc       

@fredrikhl
Copy link
Author

So, the insertion of <Plug>(over-restore-search-pattern) seems to happen when I leave insert-mode, then quickly change back into insert-mode (with i or shift+a). Similarly, if I leave insert-mode, and quickly enter command-mode with :, the text is inserted there.

I assume this is caused by autocmd InsertLeave * call s:restore_options(). Similarly, I assume that the match in insert-mode is caused by autocmd InsertEnter …. So it seems that these events are registered in regular insert-mode, which I assume they're not supposed to be.

osyo-manga added a commit that referenced this issue Aug 22, 2014
@osyo-manga
Copy link
Owner

Thanks :)
Tried to correspond.
Please update plugin and check.

@fredrikhl
Copy link
Author

Hm, okay. The problem is lesser, meaning less text is inserted – now <Plug>(over-restore-nohlsearch) is inserted instead of <Plug>(over-restore-search-pattern) :)

I figured out part the problem -- and somewhere in my vimrc, I call over#setup(). I basically bind the functionality in the command line to input-mode myself – and now I feel like an idiot… This explains my woes in insert-mode, and why there's not a lot of people complaining about this! If you had problems reproducing, this might be the reason…

However, this is still a bug – if you exit, then enter insert-mode in the command line window, you'll get the same results.

How to reproduce: In normal-mode press q: to open the command line window. Write i to enter insert-mode, then type s,some text,. Then press esc to exit insert-mode, and quickly press i again, and <Plug>(over-restore-nohlsearch) is inserted on the command line.

@osyo-manga
Copy link
Owner

hmmm....but I can't reproduce :(

@jwmann
Copy link

jwmann commented Oct 24, 2017

Can't reproduce either.

@fredrikhl
Copy link
Author

This can probably be closed. Vim-over works perfect on my current vim-setup, and has been for years. May have been some conflict with the specific vim-version I was running at that time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants