xolox / vim-easytags

Automated tag file generation and syntax highlighting of tags in Vim
http://peterodding.com/code/vim/easytags/
1.01k stars 109 forks source link

[ERROR] (permission problem) tags file isn't writable ! #29

Closed stardiviner closed 11 years ago

stardiviner commented 11 years ago

I execute command :help eval.txt, and the press <C-]> on vim help tag, get an error:

Error detected while processing function xolox#easytags#register..xolox#easytags#get_tagsfile:                                                                                                 
line   21:                                                                                                                                                                                     
E605: Exception not caught: The tags file /usr/share/vim/vim73/doc/tags isn't writable! 

Then I press <C-t> to jump back, get error:

Error detected while processing /usr/share/vim/vim73/syntax/syntax.vim:                                                                                                                        
line   15:                                                                                                                                                                                     
E171: Missing :endif                                                                                                                                                                           
Error detected while processing function <SNR>120_Prev:                                                                                                                                        
line   10:                                                                                                                                                                                     
E171: Missing :endif                  
stardiviner commented 11 years ago

I think an dirty solution is check the tags permission, if not writable, then generate a temporarily tags file in /tmp dir.

stardiviner commented 11 years ago

I know why now, I set option let g:easytags_dynamic_files = 2, so that easytags will create tags file when I open help file with :help motion.txt in /usr/share/vim/vim73/doc/. I checked a part source code of easytags, found it will check some situation like whether tags file is writable() etc. I think if user set let g:easytags_dynamic_files = 2, then easytags should check writable() and if not writable, then should fall back to global tags file setting let g:easytags_file =. I prefer easytags to auto create project specific tags file.

stardiviner commented 11 years ago

please take this. https://github.com/xolox/vim-easytags/pull/35

xolox commented 11 years ago

Thanks for the bug report! This should be fixed in commit 1aae392a30ed478f706c2e19e15df858991adb79 (also referenced on the GitHub issue page): When g:easytags_dynamic_files is 2 and the directory of the buffer is not writable, the plug-in will fall back to a file type specific tags file or the global tags file.

When the new behavior activates, the plug-in will print a warning message. I added that because this new behavior seems more user friendly, but might surprise some users.

I'm closing this issue now as the problem should be resolved. If it's not, feel free to reopen the issue.