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

Already on GitHub? Sign in to your account

<BS> doesn't seem to work. #51

Open
romainl opened this Issue Apr 12, 2012 · 9 comments

Comments

Projects
None yet
4 participants

romainl commented Apr 12, 2012

I'm using an up to date MacVim 7.3 both in GUI and CLI mode on Mac OS X 10.6.8 and a slightly older Vim 7.3 also in GUI and CLI mode on Ubuntu 10.10.

When I type (, smartinput correctly inserts the matching ) but I'm not able to "undo" the () pair by hitting <BS>. Only the first ( is deleted instead of both parenthesis. Of course, it's the same for all the other pairs ''""{}[].

Please let me know if you need more informations.

Thank you.

Owner

kana commented Apr 12, 2012

Please tell me the result of :set backspace? in your Vim. I suspect it depends on your 'backspace' value, because several rules require that 'backspace' is set to "indent,eol,start" or 2.

  • If the result is neither backspace=indent,eol,start nor backspace=2, please :set backspace=indent,eol,start.
  • Otherwise, it might be a bug in vim-smartinput. Please tell me the result of :version. I'll investigate it later.
Owner

kana commented Apr 12, 2012

Only the first ( is deleted instead of both parenthesis.

Ah, I overlooked this sentence. It might be caused by key mappings which are defined in your vimrc or other plugins.
Please let me know the results of :imap <BS> and :imap <Del> in your Vim.

romainl commented Apr 12, 2012

Thanks for your reply.

I have set backspace=indent,eol,start in my ~/.vimrc. :set backspace? returns the same line so it's not overwritten anywhere.

My :version:

VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Jul 27 2011 19:46:24)
MacOS X (unix) version
Included patches: 1-260
Compiled by Bjorn Winckler <bjorn.winckler@gmail.com>
Huge version with MacVim GUI.  Features included (+) or not (-):
+arabic +autocmd +balloon_eval +browse ++builtin_terms +byte_offset +cindent +clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments +conceal +cryptv +cscope 
+cursorbind +cursorshape +dialog_con_gui +diff +digraphs +dnd -ebcdic +emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path +find_in_path +float +folding -footer +fork() 
+fullscreen -gettext -hangul_input +iconv +insert_expand +jumplist +keymap +langmap +libcall +linebreak +lispindent +listcmds +localmap -lua +menu +mksession +modify_fname +mouse 
+mouseshape +mouse_dec -mouse_gpm -mouse_jsbterm +mouse_netterm -mouse_sysmouse +mouse_xterm +multi_byte +multi_lang -mzscheme +netbeans_intg +odbeditor +path_extra +perl 
+persistent_undo +postscript +printer +profile +python -python3 +quickfix +reltime +rightleft +ruby +scrollbind +signs +smartindent -sniff +startuptime +statusline -sun_workshop +syntax 
+tag_binary +tag_old_static -tag_any_white -tcl +terminfo +termresponse +textobjects +title +toolbar +transparency +user_commands +vertsplit +virtualedit +visual +visualextra +viminfo 
+vreplace +wildignore +wildmenu +windows +writebackup -X11 -xfontset +xim -xsmp -xterm_clipboard -xterm_save 
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
      user exrc file: "$HOME/.exrc"
  system gvimrc file: "$VIM/gvimrc"
    user gvimrc file: "$HOME/.gvimrc"
    system menu file: "$VIMRUNTIME/menu.vim"
  fall-back for $VIM: "/Applications/MacVim.app/Contents/Resources/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_MACVIM -Wall -Wno-unknown-pragmas -pipe  -DMACOS_X_UNIX -no-cpp-precomp  -g -O2 -D_FORTIFY_SOURCE=1      
Linking: gcc   -L.         -Wl,-syslibroot,/Developer/SDKs/MacOSX10.6.sdk -L/usr/local/lib -o Vim -framework Cocoa -framework Carbon      -lncurses  -liconv -framework Cocoa    -fstack-protector -L/usr/local/lib  -L/System/Library/Perl/5.10/darwin-thread-multi-2level/CORE -lperl -lm -lutil -lc -framework Python   -framework Ruby   

Thanks again for your help.

romainl commented Apr 12, 2012

  1. :verbose imap <BS>

    i    <BS>    & <SNR>28__trigger_or_fallback("\<BS>", "\<BS>")
        Last set from ~/.vim/bundle/smartinput/autoload/smartinput.vim
    
  2. :verbose imap <Del>

    No mapping found
    

Ho, I forgot to add that I use 0.0.5.

Thanks again.

Owner

kana commented Apr 12, 2012

Thank you for the information. I'll investigate it later.

By the way, is the problem still reproducible if Vim is invoked by the following command?

vim -u NONE -i NONE -N -c "set backspace=2 runtimepath^=$HOME/.vim/bundle/smartinput | runtime! plugin/smartinput.vim"

romainl commented Apr 12, 2012

No. Backspacing works as advertised with this command. It means that the problem is elsewhere.

My vimfiles are here.

amjith commented Jun 11, 2012

I'm seeing the same problem as @romainl.

:version
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Jan  2 2012 17:38:47)
MacOS X (unix) version
Included patches: 1-390
Compiled by Bjorn Winckler <bjorn.winckler@gmail.com>
Huge version with MacVim GUI.  Features included (+) or not (-):
+arabic +autocmd +balloon_eval +browse ++builtin_terms +byte_offset +cindent +clientserver +clipboard +cmdline_compl +cmdline_hist
+cmdline_info +comments +conceal +cryptv +cscope +cursorbind +cursorshape +dialog_con_gui +diff +digraphs +dnd -ebcdic +emacs_tags
+eval +ex_extra +extra_search +farsi +file_in_path +find_in_path +float +folding -footer +fork() +fullscreen -gettext -hangul_input
+iconv +insert_expand +jumplist +keymap +langmap +libcall +linebreak +lispindent +listcmds +localmap -lua +menu +mksession
+modify_fname +mouse +mouseshape +mouse_dec -mouse_gpm -mouse_jsbterm +mouse_netterm -mouse_sysmouse +mouse_xterm +mouse_urxvt
+multi_byte +multi_lang -mzscheme +netbeans_intg +odbeditor +path_extra +perl +persistent_undo +postscript +printer +profile +python
-python3 +quickfix +reltime +rightleft +ruby +scrollbind +signs +smartindent -sniff +startuptime +statusline -sun_workshop +syntax
+tag_binary +tag_old_static -tag_any_white -tcl +terminfo +termresponse +textobjects +title +toolbar +transparency +user_commands
+vertsplit +virtualedit +visual +visualextra +viminfo +vreplace +wildignore +wildmenu +windows +writebackup -X11 -xfontset +xim -xsmp
-xterm_clipboard -xterm_save
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
      user exrc file: "$HOME/.exrc"
  system gvimrc file: "$VIM/gvimrc"
    user gvimrc file: "$HOME/.gvimrc"
    system menu file: "$VIMRUNTIME/menu.vim"
  fall-back for $VIM: "/Applications/MacVim.app/Contents/Resources/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_MACVIM -Wall -Wno-unknown-pragmas -pipe  -DMACOS_X_UNIX -no-cpp-precomp  -g
-O2 -arch i386 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc   -L.    -L.         -arch i386 -L/usr/local/lib -o Vim -framework Cocoa -framework Carbon      -lncurses  -liconv -framew
ork Cocoa    -fstack-protector -L/usr/local/lib  -L/System/Library/Perl/5.12/darwin-thread-multi-2level/CORE -lperl -lm -lutil -lc -fra
mework Python   -framework Ruby
backspace=indent,eol,start
:verbose imap<BS>
no mapping found
:verbose imap<Del>
no mapping found

My vim files are here: https://github.com/amjith/dot_vim

amjith commented Jun 11, 2012

I just cross-referenced my plugins with @romainl's plugins and found the problem plugin.

If I remove the autocomplpop plugin, the BS works as advertised. I wonder what's the conflict between the two plugins.

ACP.vim remaps backspace internally, but IIRC it does not restore the mapping. ACP.vim is also one of the most popular plugins so it would be nice to have smart-input work well with it (even if that means that we must fix ACP.vim) NeocomplCache (ACP.vim alternative) does not ruin the <BS> mappings in the same way that ACP.vim however, it's nowhere near as fast as ACP.vim so I'd like to get these two plugins working correctly together.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment