Bug in hoist logging?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Bug in hoist logging?

Herbert Sitz
I had problems with an error message I received on both Windows and Linux versions using the hoist command.  I think I tracked this down to a bug in the construction of the filename used for saving the hoist log.  (Or was this somehow working for other people?)

The line that was creating the problem appears to be the one at around line 164 in vo_hoist.vim.
line163  " log what we did incase we need to recover manually
line164  let l:doit = l:parent."write! >> .vo_hoist.".bufname(bufnr("%")).".log"

That line prepends '.vo_host.' to the buffername, which on both of my installations was the full path to the current file.  That is, on Windows the bufname was something like 'C:\my documents\. . . ', with result that it tried to save file with name of '.vo_hoist.C:\My Documents\. . . '.  Obviously a problem, and an analogous problem existed on my Linux install.  These resulted in an error when trying to create the log file.

Hoisting worked despite the error; there just wasn't any hoist log anywhere if you ever needed to use it.

For a fix I changed the line to save the log to an appropriate filename in the directory of the open file:

newline164   let l:doit = l:parent."write! >> ".expand("%:h")."/.vo_hoist.".expand("%:t").".log"

For a filename of /pathpart1/parthpart2/myvim.otl this will put the log in:

/pathpart1/pathpart2/.vo_hoist.myvim.otl.log

Hope that helps someone.  Though I haven't seen complaints about the error in archives so I'm kind of wondering whether I'm crazy.