uri_dropped on Windows

From: Robert <ro....at.web.de>
Date: Mon, 12 Jul 2010 09:08:12 +0200

if I drop a file on Textadept on Windows 2000 to open it its filename
contains forward slashes. When I open the file with the file dialog it
is opened again with forward slashes.

I changed the uri_dropped event to replace the forward slashes with
backward slashes which seems to fix it.

events.lua, l.312

    local lfs = require 'lfs'
    for utf8_uri in utf8_uris:gmatch('[^\r\n\f]+') do
      if utf8_uri:find('^file://') then
        utf8_uri = utf8_uri:match('^file://([^\r\n\f]+)')
        utf8_uri = utf8_uri:gsub('%%(%x%x)',
          function(hex) return string.char(tonumber(hex, 16)) end)
        if WIN32 then
          utf8_uri = utf8_uri:sub(2, -1) -- ignore leading '/'
          utf8_uri = utf8_uri:gsub('/', '\\')
        local uri = utf8_uri:iconv(_CHARSET, 'UTF-8')
        if lfs.attributes(uri).mode ~= 'directory' then

Received on Mon 12 Jul 2010 - 03:08:12 EDT

This archive was generated by hypermail 2.2.0 : Thu 08 Mar 2012 - 11:50:23 EST