From 8ab67ae03b55b8718bea4bba638af2994d333c13 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Tue, 25 May 2010 14:23:25 -0400 Subject: Fixed Mac OSX paste issue; core/events.lua --- core/events.lua | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'core') 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', -- cgit v1.2.3