aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2009-01-25 10:56:55 -0500
committermitchell <70453897+667e-11@users.noreply.github.com>2009-01-25 10:56:55 -0500
commitdb102bc9448f0606fd3750c8961863af9483ebfc (patch)
treee16ebe6de766fa713e3facbdccc60d51223756a5
parent6f885b3036d4db50104877945af7c9c89c4d922d (diff)
downloadtextadept-db102bc9448f0606fd3750c8961863af9483ebfc.tar.gz
textadept-db102bc9448f0606fd3750c8961863af9483ebfc.zip
Fixed bug with URI dropping and do nothing with directory drops; core/events.lua
-rw-r--r--core/events.lua9
1 files changed, 5 insertions, 4 deletions
diff --git a/core/events.lua b/core/events.lua
index ce91452c..d7897c6d 100644
--- a/core/events.lua
+++ b/core/events.lua
@@ -408,14 +408,15 @@ add_handler('save_point_left',
add_handler('uri_dropped',
function(uris)
+ local lfs = require 'lfs'
for uri in uris:gmatch('[^\r\n\f]+') do
if uri:match('^file://') then
uri = uri:match('^file://([^\r\n\f]+)')
- if WIN32 then
- uri = uri:sub(2, -1) -- ignore leading '/'
- uri = uri:gsub('%%20', ' ') -- sub back for spaces
+ uri = uri:gsub('%%20', ' ') -- sub back for spaces
+ if WIN32 then uri = uri:sub(2, -1) end -- ignore leading '/'
+ if lfs.attributes(uri).mode ~= 'directory' then
+ textadept.io.open(uri)
end
- textadept.io.open(uri)
end
end
end)