Re: Obscure bug of the week

From: Robert <ro....at.web.de>
Date: Mon, 21 Jun 2010 10:51:05 +0200

On Sat, Jun 19, 2010 at 6:45 PM, Brian Schott <briancsch....at.gmail.com> wrote:
> I ran into this while creating a module that auto-generates function
> call tips for the D language in the TA 3 alpha:
>
> 1. In a language module, connect some function to 'save_point_reached'
> 2. Give that function a syntax error
> 3. Try to save a file of that file type
> 4. A dialog saying that the file has been modified outside of TA shows
> up. (Even though it hasn't.)
> 5. Click "Yes" to attempt reloading.
> 6. l_call_function and l_emit_event call each other endlessly
> resulting in a segmentation fault
>

This is probably unrelated but it reminded me of a bug I now tracked down.
When using "save_as" in file_io.lua a check should be added to make
sure that no buffer with the same path and name is already open,
otherwise you get two buffers with the same filename and the reloading
problem as you switch buffers.
So after the dialog, line 276 in file_io.lua
for i=1, #_BUFFERS do
  if _BUFFERS[i].filename == utf8_filename then
    -- some error message to give the user the possibility
    -- to close the other buffer or try saving as again with another name
    return
  end
end

Robert
Received on Mon 21 Jun 2010 - 04:51:05 EDT

This archive was generated by hypermail 2.2.0 : Thu 08 Mar 2012 - 11:48:28 EST