From e6cac1c716ce3cadab1a7ed45ec2dbb963270acb Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Thu, 2 Apr 2009 17:47:53 -0400 Subject: Removed macro support; just use Lua for scripting. --- core/ext/key_commands.lua | 2 -- core/ext/menu.lua | 13 ------------ core/ext/pm/macro_browser.lua | 47 ------------------------------------------- 3 files changed, 62 deletions(-) delete mode 100644 core/ext/pm/macro_browser.lua (limited to 'core/ext') diff --git a/core/ext/key_commands.lua b/core/ext/key_commands.lua index 4a40ea5a..9f449679 100644 --- a/core/ext/key_commands.lua +++ b/core/ext/key_commands.lua @@ -173,7 +173,6 @@ if not MAC then c = { pm_activate, 'ctags' }, b = { pm_activate, 'buffers' }, f = { pm_activate, '/' }, - -- TODO: { pm_activate, 'macros' } m = { pm_activate, 'modules' }, } @@ -361,7 +360,6 @@ else c = { pm_activate, 'ctags' }, b = { pm_activate, 'buffers' }, f = { pm_activate, '/' }, - -- TODO: { pm_activate, 'macros' } m = { pm_activate, 'modules' }, } diff --git a/core/ext/menu.lua b/core/ext/menu.lua index 963967ab..81e9f473 100644 --- a/core/ext/menu.lua +++ b/core/ext/menu.lua @@ -97,9 +97,6 @@ local ID = { CLEAR_BOOKMARKS = 417, GOTO_NEXT_BOOKMARK = 418, GOTO_PREV_BOOKMARK = 419, - START_RECORDING_MACRO = 413, - STOP_RECORDING_MACRO = 414, - PLAY_MACRO = 415, -- Buffer NEXT_BUFFER = 501, PREV_BUFFER = 502, @@ -244,11 +241,6 @@ local menubar = { { l.MENU_TOOLS_BM_NEXT, ID.GOTO_NEXT_BOOKMARK }, { l.MENU_TOOLS_BM_PREV, ID.GOTO_PREV_BOOKMARK }, }, - { title = l.MENU_TOOLS_MACROS_TITLE, - { l.MENU_TOOLS_MACROS_START, ID.START_RECORDING_MACRO }, - { l.MENU_TOOLS_MACROS_STOP, ID.STOP_RECORDING_MACRO }, - { l.MENU_TOOLS_MACROS_PLAY, ID.PLAY_MACRO }, - }, }, gtkmenu { title = l.MENU_BUF_TITLE, @@ -306,7 +298,6 @@ local m_snippets = _m.textadept.lsnippets local m_editing = _m.textadept.editing local m_mlines = _m.textadept.mlines local m_bookmarks = _m.textadept.bookmarks -local m_macros = _m.textadept.macros local m_run = _m.textadept.run local function set_encoding(encoding) @@ -428,10 +419,6 @@ local actions = { [ID.CLEAR_BOOKMARKS] = { m_bookmarks.clear }, [ID.GOTO_NEXT_BOOKMARK] = { m_bookmarks.goto_next }, [ID.GOTO_PREV_BOOKMARK] = { m_bookmarks.goto_prev }, - -- Tools -> Macros - [ID.START_RECORDING_MACRO] = { m_macros.start_recording }, - [ID.STOP_RECORDING_MACRO] = { m_macros.stop_recording }, - [ID.PLAY_MACRO] = { m_macros.play }, -- Buffer [ID.NEXT_BUFFER] = { 'goto_buffer', v, 1, false }, [ID.PREV_BUFFER] = { 'goto_buffer', v, -1, false }, diff --git a/core/ext/pm/macro_browser.lua b/core/ext/pm/macro_browser.lua deleted file mode 100644 index d7cde6bd..00000000 --- a/core/ext/pm/macro_browser.lua +++ /dev/null @@ -1,47 +0,0 @@ --- Copyright 2007-2009 Mitchell mitchellcaladbolg.net. See LICENSE. - -local textadept = _G.textadept -local locale = _G.locale - ---- --- Macro browser for the Textadept project manager. --- It is enabled with the prefix 'macros' in the project manager entry field. -module('textadept.pm.browsers.macro', package.seeall) - -if not RESETTING then textadept.pm.add_browser('macros') end - -function matches(entry_text) - return entry_text:sub(1, 7) == 'macros' -end - -function get_contents_for() - local m_macros = _m.textadept.macros - local contents = {} - for name in pairs(m_macros.list) do contents[name] = { text = name } end - return contents -end - -function perform_action(selected_item) - _m.textadept.macros.play(selected_item[2]) - view:focus() -end - -local ID = { DELETE = 1 } - -function get_context_menu(selected_item) - return { { locale.PM_BROWSER_MACRO_DELETE, ID.DELETE } } -end - -function perform_menu_action(menu_id, selected_item) - local m_macros = _m.textadept.macros - if menu_id == ID.DELETE then - m_macros.delete(selected_item[2]) - end - textadept.pm.activate() -end - -local function update_view() - if matches(textadept.pm.entry_text) then textadept.pm.activate() end -end -textadept.events.add_handler('macro_saved', update_view) -textadept.events.add_handler('macro_deleted', update_view) -- cgit v1.2.3