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

Kind of "freeze" on Windows 7 #44

Closed
gilbertwyw opened this issue Mar 8, 2013 · 18 comments
Closed

Kind of "freeze" on Windows 7 #44

gilbertwyw opened this issue Mar 8, 2013 · 18 comments

Comments

@gilbertwyw
Copy link

I installed it the pathogen way.
But vim kept flickering, I couldn't type anything. After the plugin removed, vim works as before again.

So is Windows supported?

Git:
git version 1.8.1.msysgit.1

Gvim:
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Oct 27 2010 17:59:02)
MS-Windows 32-bit GUI version with OLE support
Included patches: 1-46
Compiled by Bram@KIBAALE
Big version with 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 +gettext/dyn -hangul_input
+iconv/dyn +insert_expand +jumplist +keymap +langmap +libcall +linebreak
+lispindent +listcmds +localmap -lua +menu +mksession +modify_fname +mouse
+mouseshape +multi_byte_ime/dyn +multi_lang -mzscheme +netbeans_intg +ole
-osfiletype +path_extra +perl/dyn +persistent_undo -postscript +printer
-profile +python/dyn +python3/dyn +quickfix +reltime +rightleft +ruby/dyn
+scrollbind +signs +smartindent -sniff +startuptime +statusline -sun_workshop
+syntax +tag_binary +tag_old_static -tag_any_white +tcl/dyn -tgetent
-termresponse +textobjects +title +toolbar +user_commands +vertsplit
+virtualedit +visual +visualextra +viminfo +vreplace +wildignore +wildmenu
+windows +writebackup -xfontset -xim -xterm_save +xpm_w32
system vimrc file: "$VIM\vimrc"
user vimrc file: "$HOME_vimrc"
2nd user vimrc file: "$VIM_vimrc"
user exrc file: "$HOME_exrc"
2nd user exrc file: "$VIM_exrc"
system gvimrc file: "$VIM\gvimrc"
user gvimrc file: "$HOME_gvimrc"
2nd user gvimrc file: "$VIM_gvimrc"
system menu file: "$VIMRUNTIME\menu.vim"
Compilation: cl -c /W3 /nologo -I. -Iproto -DHAVE_PATHDEF -DWIN32 -DFEAT_CSCOPE
-DFEAT_NETBEANS_INTG -DFEAT_XPM_W32 -DWINVER=0x0400 -D_WIN32_WINNT=0x0400
/Fo.\ObjGOLYHTR/ /Ox /GL -DNDEBUG /Zl /MT -DFEAT_OLE -DFEAT_MBYTE_IME -DDYNAMIC_IME
-DFEAT_GUI_W32 -DDYNAMIC_ICONV -DDYNAMIC_GETTEXT -DFEAT_TCL -DDYNAMIC_TCL
-DDYNAMIC_TCL_DLL="tcl83.dll" -DDYNAMIC_TCL_VER="8.3" -DFEAT_PYTHON -DDYNAMIC_PYTHON
-DDYNAMIC_PYTHON_DLL="python27.dll" -DFEAT_PYTHON3 -DDYNAMIC_PYTHON3
-DDYNAMIC_PYTHON3_DLL="python31.dll" -DFEAT_PERL -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL="perl51
2.dll" -DFEAT_RUBY -DDYNAMIC_RUBY -DDYNAMIC_RUBY_VER=191 -DDYNAMIC_RUBY_DLL="msvcrt-ruby191
.dll" -DFEAT_BIG /Fd.\ObjGOLYHTR/ /Zi
Linking: link /RELEASE /nologo /subsystem:windows /LTCG:STATUS oldnames.lib kernel32.lib advapi32.lib
shell32.lib gdi32.lib comdlg32.lib ole32.lib uuid.lib /machine:i386 /nodefaultlib gdi32.lib version.lib winspool.lib
comctl32.lib advapi32.lib shell32.lib /machine:i386 /nodefaultlib libcmt.lib oleaut32.lib user32.lib
/nodefaultlib:python27.lib /nodefaultlib:python31.lib e:\tcl\lib\tclstub83.lib WSock32.lib e:\xpm\lib\libXpm.lib
/PDB:gvim.pdb -debug

would love to see this working on Windows

@airblade
Copy link
Owner

airblade commented Mar 8, 2013

Please can you try the fix suggested in #42?

@airblade
Copy link
Owner

I've just updated the code. Please could you try it again to see if it fixes your problem?

@gilbertwyw
Copy link
Author

Sorry, it's my office PC so I couldn't try your fix at once.
I just upgraded your code. No more "freezing" but I don't see git's +/- in the in the file modified (not committed yet) or those been committed.

I even tried the commands :GitGutter, :GitGutterLineHighlightsEnable

Please let me know there's anything else I can do.

Thanks for your kindly help.

@airblade
Copy link
Owner

It should work on Windows but I'm not sure what the problem is here. Please could you tell me what you get with these?

:echo &shell
:echo &shellredir
:echo has('signs')
:echo system('git')

Do you happen to use Syntastic and, if so, do its signs show up for you?

@gilbertwyw
Copy link
Author

I have Syntastic installed and its sign does show up.

:echo &shell

C:\Windows\system32\cmd.exe

:echo &shellredir

> %s 2>&1

:echo has('signs')

1

:echo system('git')

usage: git [--version] [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p|--paginate|--no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           [-c name=value] [--help]
           <command> [<args>]

The most commonly used git commands are:
   add        Add file contents to the index
   bisect     Find by binary search the change that introduced a bug
   branch     List, create, or delete branches
   checkout   Checkout a branch or paths to the working tree
   clone      Clone a repository into a new directory
   commit     Record changes to the repository
   diff       Show changes between commits, commit and working tree, etc
   fetch      Download objects and refs from another repository
   grep       Print lines matching a pattern
   init       Create an empty git repository or reinitialize an existing one
   log        Show commit logs
   merge      Join two or more development histories together
   mv         Move or rename a file, a directory, or a symlink
   pull       Fetch from and merge with another repository or a local branch
   push       Update remote refs along with associated objects
   rebase     Forward-port local commits to the updated upstream head
   reset      Reset current HEAD to the specified state
   rm         Remove files from the working tree and from the index
   show       Show various types of objects
   status     Show the working tree status
   tag        Create, list, delete or verify a tag object signed with GPG

See 'git help <command>' for more information on a specific command.

Thanks a lot.

@airblade
Copy link
Owner

Thanks for all that. I'm still not sure what the problem is but hopefully we'll get there...

Is your Vim using the git you want it to? (:echo system('git --version')). There have been a couple of cases where Vim was using an older git than the person's shell, and they had some git configuration which wasn't compatible with the version of git their Vim was using.

Just now I made some updates. Please could you grab the latest version of the plugin and try again? (Your problem sounds quite like the bug reported in #45 which is now fixed.)

If it still doesn't work, would you mind describing the problem in more detail? You said Vim flickers and you can't type anything. Is that all the time, or only when you open/save a file being tracked by Git? Do the signs actually appear?

@gilbertwyw
Copy link
Author

Sorry, it's my office PC so couldn't let you know as soon as I could.

:echo system('git --version')

show exactly the same version as the one I use in the command prompt

I've just upgraded gitgutter but still do not see the +/- sign

Is there an option that always display the gutter? Because Syntastic is able to show ">>" in the gutter after I saved the javascript file with errors.

Thanks for your help.

@airblade
Copy link
Owner

You can have the sign column (gutter) always displayed by adding let g:gitgutter_sign_column_always = 1 to your vimrc.

So we know your Vim supports signs and we know it can reach git. Maybe the problem is to do with using pipes in the shell commands.

Can you try this? (Replace /path/to/directory with the path to the directory of your current file.)

:system ("cd /path/to/directory && git rev-parse > /dev/null 2>&1")
:echom v:shell_error

...and let me know the result of v:shell_error.

@gilbertwyw
Copy link
Author

:system ("cd /path/to/directory && git rev-parse > /dev/null 2>&1")

I'm on a PC, so I'm afraid this part "/dev/null 2>&1" not work for me.

and Gvim showed

E492: Not an editor command: system ("cd D:/works/git-svn/myproject/
:echom v:shell_error

returns 255

@airblade
Copy link
Owner

So I think the reason vim-gitgutter isn't doing anything for you is because of that E492 error, causing v:shell_error to be non-zero.

But just to check that that is what the plugin actually tries, please could you do this?

:echom shellescape(fnamemodify(expand('%:p'), ':h'))

@gilbertwyw
Copy link
Author

:echom shellescape(fnamemodify(expand('%:p'), ':h'))

return my project path:

"D:\works\git-svn\myproject"

Hope this helps. Thanks.

@airblade
Copy link
Owner

I wonder whether this is related to vim-ruby/vim-ruby#143? The comments there suggest that the 2>&1 that vim-gitgutter uses would need to be 2>^&1. Unfortunately I don't have a Windows box to test this on.

Or maybe it's because cd doesn't work when the path starts with the drive? Does cd D:\works\git-svn\myproject work for you if you run it from your shell in the directory from which you start Vim?

@robi-wan
Copy link

Windows shell escaping is ... challenging.
Vundle had also issues with this: VundleVim/Vundle.vim#243, VundleVim/Vundle.vim#45:

  • When changing directories under Windows add '/d' to also switch drive
  • Commands must be escaped when combining commands.

@airblade
Copy link
Owner

@robi-wan Thank you! That's very helpful.

@airblade
Copy link
Owner

I'd love to fix this myself...but since I don't have access to a Windows box to test my code on, I don't want to end up releasing multiple random attempts to make it work.

If somebody could reproduce the problem and get it working again, I'd be delighted to merge a pull request.

@gilbertwyw
Copy link
Author

Sorry, i wish i can help more

@airblade Thank you so much for your help
Maybe you can point me which part of the source that i can try to modify to test it with my setup

And if there's anyone can help create a branch for this, i'll be glad to checkout and test it

@airblade
Copy link
Owner

@gilbertwyw Here are the places to tinker:

Good luck!

@airblade
Copy link
Owner

Closing because this has gone quiet. Let me know if it's still a problem.

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