Re: [textadept] Re: Problem with Windows io.popen

From: Robert <ro....at.web.de>
Date: Fri, 6 May 2011 13:49:15 +0200

On Fri, May 6, 2011 at 1:30 PM, steve donovan <steve.j.dono....at.gmail.com> wrote:
> On Fri, May 6, 2011 at 1:12 PM, steve donovan <steve.j.dono....at.gmail.com> wrote:
>> in the error window does not do what I expect; TA opens the Lua file
>> in the view previously occupied by the error buffer and brings up a
>> tooltip.
>
> Well, it is just doing what we tell it ;)
>
>          io.open_file(utf8_filename)
>          _m.textadept.editing.goto_line(captures[error_detail.line])
>
> and io.open_file will just do this:
>
>  for i, buffer in ipairs(_BUFFERS) do
>    if utf8_filename == buffer.filename then
>      view:goto_buffer(i)
>      return
>    end
>  end
>
> So the behaviour I expected would require first a search through the
> views to find if the file is already visible, and switch to that,
> otherwise fall back to io.open_file
>
> steve

The code from find.lua could be reused which works as you describe.

Robert
Received on Fri 06 May 2011 - 07:49:15 EDT

This archive was generated by hypermail 2.2.0 : Thu 08 Mar 2012 - 12:06:30 EST