spf13 / spf13-vim

The ultimate vim distribution
http://vim.spf13.com
Apache License 2.0
15.56k stars 3.63k forks source link

mkview bails if the viewfile filename is too long. #269

Open labeneator opened 11 years ago

labeneator commented 11 years ago

Steps to reproduce: 1) Edit a file with a long path:

vim /home/xxxxxx/aws-java-sdk/1.3.27/samples/AwsFlowFramework/src/com/amazonaws/services/simpleworkflow/flow/examples/helloworld/HelloWorldWorkflowImpl.java

2) Split your session to attempt to read a different file. Vim attempts to create a vimview file with a name composed of components from the path. This may exceed the fs limit.

Error detected while processing WinLeave Auto commands for "?*":
E190: Cannot open "/home/xxxx/.vimviews/~=+aws-java-sdk=+1.3.27=+samples=+AwsFlowFramework=+src=+com=+amazonaws=+services=+simpleworkflow=+flow=+examples=+helloworld=+He
lloWorldActivitiesImpl.java=" for writing

3) My shell confirms this:

$ touch /home/xxxxx/.vimviews/~=+aws-java-sdk=+1.3.27=+samples=+AwsFlowFramework=+src=+com=+amazonaws=+services=+simpleworkflow=+flow=+examples=+helloworld=+HelloWorldActivitiesImpl.java=
touch: cannot touch `/home/xxxxx/.vimviews/~=+aws-java-sdk=+1.3.27=+samples=+AwsFlowFramework=+src=+com=+amazonaws=+services=+simpleworkflow=+flow=+examples=+helloworld=+HelloWorldActivitiesImpl.java=': File name too long

4) Possible solution: Extract a substring from the filename and concat it with a hash?

labeneator commented 11 years ago

Trigger found ~/.spf13-vim-3/.vim/bundle/restore_view.vim/pluginrestore_view.vim 60 autocmd BufWritePost,WinLeave,BufWinLeave ?* if MakeViewCheck() | mkview | endif

Skipping anything with a filepath that's larger that 32 characters: Patch: https://gist.github.com/4584577

The ultimate solution would be to give mkview and loadview a shorter viewfile if the viewfile is too large.

peterfig commented 11 years ago

Thank you for finding this and posting this fix. The error about made my head explode. Several times.

hackhowtofaq commented 10 years ago

Great! Thank you!

This bug is still there

Could you please merge this to readme?

labeneator commented 10 years ago

@hackhowtofaq, @peterfig Could you point me at the right readme to update?

PS: I can no longer reproduce this issue on OSX. Perhaps Apple has bumped up the HFS limits...

Pacodastre commented 9 years ago

The error is still happening for me on linuxmint. Is there a simple way arround it ? It is pretty annoying