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

From: steve donovan <>
Date: Fri, 6 May 2011 13:59:43 +0200

On Fri, May 6, 2011 at 1:49 PM, Robert <> wrote:
> The code from find.lua could be reused which works as you describe.

Right, yes, that's exactly right. It is easy enough to patch, but
better to reuse code.

My fix went like this: replace the call to io.open_file(utf8_filename)
in goto_error with this function:

local function find_view_or_buffer(utf8_filename)
  local file_buffer
  for i, b in ipairs(_BUFFERS) do
    if utf8_filename == b.filename then
      file_buffer = b
  if file_buffer then
    for j, vw in ipairs(_VIEWS) do
      if vw.doc_pointer == file_buffer.doc_pointer then
  -- otherwise, ask TA to open the buffer

These search-in-buffer and search-in-views patterns are certainly
common enough to be factored out, say as gui.find_buffer(filename) and

steve d.
Received on Fri 06 May 2011 - 07:59:43 EDT

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