Re: Question about File > Open and the "Untitled" buffer

From: mitchell <mforal.n....at.gmail.com>
Date: Sun, 11 Apr 2010 13:25:54 -0700 (PDT)

Brian,

On Apr 11, 3:08 pm, Robert <ro....at.web.de> wrote:
> On Apr 10, 9:21 am, Brian Schott <briancsch....at.gmail.com> wrote:
> ...
>
> > and they were utterly vanquished.
>
> Ugh. There is a problem... When you close all buffers, and only one
> Untitled buffer remains it becomes quite easy to crash Textadept. When
> you have a look at the side pane view of the buffer list in 2.1 it can
> be seen how once you close the Untitled buffer immediately another
> appears. With the new "new buffer" event this seems to become a
> problem.
> A quick fix could be something like this (Don't close if there is only
> one clean Untitled buffer):
> --- a/core/file_io.lua  Sun Apr 11 12:09:10 2010 +0200
> +++ b/core/file_io.lua  Sun Apr 11 20:58:15 2010 +0200
> @@ -322,6 +322,10 @@
>  -- @usage buffer:close()
>  function close(buffer)
>    textadept.check_focused_buffer(buffer)
> +  local b = textadept.buffers[1]
> +  if #textadept.buffers == 1 and not (b.dirty or b._type or
> b.filename) then
> +    return false
> +  end
>    if buffer.dirty and
>       textadept.dialog('msgbox',
>
> However, it's still not possible to open more than one Untitled
> buffer... maybe the "new buffer" event needs to be changed.

I have reverted the change for now. I didn't realize that another
Untitled buffer couldn't be opened. Clearly my solution isn't a good
one.

Mitchell

>
> Robert
Received on Sun 11 Apr 2010 - 16:25:54 EDT

This archive was generated by hypermail 2.2.0 : Thu 08 Mar 2012 - 11:42:59 EST