aboutsummaryrefslogtreecommitdiffhomepage
path: root/core/events.lua
diff options
context:
space:
mode:
authorGravatar mitchell <70453897+667e-11@users.noreply.github.com>2010-05-25 14:23:25 -0400
committerGravatar mitchell <70453897+667e-11@users.noreply.github.com>2010-05-25 14:23:25 -0400
commit8ab67ae03b55b8718bea4bba638af2994d333c13 (patch)
tree5bf7d915b4c6dbd7a394a36d86921d6ee05f1aff /core/events.lua
parentd553c7fe7cb5578642dfca565d094e16608b5af4 (diff)
Fixed Mac OSX paste issue; core/events.lua
Diffstat (limited to 'core/events.lua')
-rw-r--r--core/events.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/core/events.lua b/core/events.lua
index 9f5c95a1..302e6fda 100644
--- a/core/events.lua
+++ b/core/events.lua
@@ -423,6 +423,14 @@ add_handler('quit',
if MAC then
add_handler('appleevent_odoc',
function(uri) return handle('uri_dropped', 'file://'..uri) end)
+
+ textadept.events.add_handler('buffer_new',
+ function()
+ buffer.paste = function()
+ local clipboard_text = textadept.clipboard_text
+ if #clipboard_text > 0 then buffer:replace_sel(clipboard_text) end
+ end
+ end)
end
add_handler('error',