diff options
author | 2009-01-27 12:34:25 -0500 | |
---|---|---|
committer | 2009-01-27 12:34:25 -0500 | |
commit | bcf630f108fcb957b0a908b258fe3a644e189ceb (patch) | |
tree | 15fe72b3d5de757465431ecbb79154db36ae8308 /core | |
parent | f131668edad1ed20a3ac095925b602836503c8e8 (diff) | |
download | textadept-bcf630f108fcb957b0a908b258fe3a644e189ceb.tar.gz textadept-bcf630f108fcb957b0a908b258fe3a644e189ceb.zip |
Use a combo entry to either type in or select a PM browser to use.
Diffstat (limited to 'core')
-rw-r--r-- | core/ext/menu.lua | 33 | ||||
-rw-r--r-- | core/ext/pm/buffer_browser.lua | 2 | ||||
-rw-r--r-- | core/ext/pm/ctags_browser.lua | 2 | ||||
-rw-r--r-- | core/ext/pm/file_browser.lua | 2 | ||||
-rw-r--r-- | core/ext/pm/macro_browser.lua | 2 | ||||
-rw-r--r-- | core/ext/pm/modules_browser.lua | 2 | ||||
-rw-r--r-- | core/ext/pm/project_browser.lua | 2 | ||||
-rw-r--r-- | core/locale.lua | 19 |
8 files changed, 12 insertions, 52 deletions
diff --git a/core/ext/menu.lua b/core/ext/menu.lua index cc1ae5c6..13f1913e 100644 --- a/core/ext/menu.lua +++ b/core/ext/menu.lua @@ -115,15 +115,6 @@ local ID = { UNSPLIT_ALL_VIEWS = 606, GROW_VIEW = 607, SHRINK_VIEW = 608, - -- Project Manager - TOGGLE_PM_VISIBLE = 701, - FOCUS_PM = 702, - SHOW_PM_PROJECT = 703, - SHOW_PM_CTAGS = 704, - SHOW_PM_BUFFERS = 705, - SHOW_PM_FILES = 706, - SHOW_PM_MACROS = 707, - SHOW_PM_MODULES = 708, -- Lexers LEXER_ACTIONSCRIPT = 801, LEXER_ADA = 802, @@ -332,17 +323,6 @@ t.menubar = { { l.MENU_VIEW_SHRINK, ID.SHRINK_VIEW }, }, gtkmenu { - title = l.MENU_PM_TITLE, - { l.MENU_PM_TOGGLE_VISIBLE, ID.TOGGLE_PM_VISIBLE }, - { l.MENU_PM_FOCUS, ID.FOCUS_PM }, - { l.MENU_PM_BUFFERS, ID.SHOW_PM_BUFFERS }, - { l.MENU_PM_PROJECT, ID.SHOW_PM_PROJECT }, - { l.MENU_PM_FILES, ID.SHOW_PM_FILES }, - { l.MENU_PM_CTAGS, ID.SHOW_PM_CTAGS }, - { l.MENU_PM_MACROS, ID.SHOW_PM_MACROS }, - { l.MENU_PM_MODULES, ID.SHOW_PM_MODULES }, - }, - gtkmenu { title = l.MENU_LEX_TITLE, { 'actionscript', ID.LEXER_ACTIONSCRIPT }, { 'ada', ID.LEXER_ADA }, @@ -416,10 +396,6 @@ local m_bookmarks = _m.textadept.bookmarks local m_macros = _m.textadept.macros local m_run = _m.textadept.run -local function pm_activate(text) - t.pm.entry_text = text - t.pm.activate() -end local function toggle_setting(setting) local state = buffer[setting] if type(state) == 'boolean' then @@ -548,15 +524,6 @@ local actions = { [ID.SHRINK_VIEW] = { function() if view.size then view.size = view.size - 10 end end }, - -- Project Manager - [ID.TOGGLE_PM_VISIBLE] = { t.pm.toggle_visible }, - [ID.FOCUS_PM] = { t.pm.focus }, - [ID.SHOW_PM_PROJECT] = { pm_activate, 'project' }, - [ID.SHOW_PM_CTAGS] = { pm_activate, 'ctags' }, - [ID.SHOW_PM_BUFFERS] = { pm_activate, 'buffers' }, - [ID.SHOW_PM_FILES] = { pm_activate, not WIN32 and '/' or 'C:\\' }, - [ID.SHOW_PM_MACROS] = { pm_activate, 'macros' }, - [ID.SHOW_PM_MODULES] = { pm_activate, 'modules' }, } -- lexers here MUST be in the same order as in the menu diff --git a/core/ext/pm/buffer_browser.lua b/core/ext/pm/buffer_browser.lua index f9b69b8c..b92d2768 100644 --- a/core/ext/pm/buffer_browser.lua +++ b/core/ext/pm/buffer_browser.lua @@ -7,6 +7,8 @@ local textadept = _G.textadept -- It is enabled with the prefix 'buffers' in the project manager entry field. module('textadept.pm.browsers.buffer', package.seeall) +textadept.pm.add_browser('buffers') + function matches(entry_text) return entry_text:sub(1, 7) == 'buffers' end diff --git a/core/ext/pm/ctags_browser.lua b/core/ext/pm/ctags_browser.lua index 4de96096..3a4ce826 100644 --- a/core/ext/pm/ctags_browser.lua +++ b/core/ext/pm/ctags_browser.lua @@ -9,6 +9,8 @@ local textadept = _G.textadept -- is specified, the current file is parsed via ctags and its structure shown. module('textadept.pm.browsers.ctags', package.seeall) +textadept.pm.add_browser('ctags') + local FILE_OUT = '/tmp/textadept_output' --- diff --git a/core/ext/pm/file_browser.lua b/core/ext/pm/file_browser.lua index 3e95a2ce..ad70f75b 100644 --- a/core/ext/pm/file_browser.lua +++ b/core/ext/pm/file_browser.lua @@ -8,6 +8,8 @@ local textadept = _G.textadept -- manager entry field. module('textadept.pm.browsers.file', package.seeall) +textadept.pm.add_browser(not WIN32 and '/' or 'C:\\') + local lfs = require 'lfs' local os = require 'os' diff --git a/core/ext/pm/macro_browser.lua b/core/ext/pm/macro_browser.lua index eab11842..75e9e91f 100644 --- a/core/ext/pm/macro_browser.lua +++ b/core/ext/pm/macro_browser.lua @@ -7,6 +7,8 @@ local textadept = _G.textadept -- It is enabled with the prefix 'macros' in the project manager entry field. module('textadept.pm.browsers.macro', package.seeall) +textadept.pm.add_browser('macros') + function matches(entry_text) return entry_text:sub(1, 7) == 'macros' end diff --git a/core/ext/pm/modules_browser.lua b/core/ext/pm/modules_browser.lua index 9bcdd6df..174394a6 100644 --- a/core/ext/pm/modules_browser.lua +++ b/core/ext/pm/modules_browser.lua @@ -7,6 +7,8 @@ local textadept = _G.textadept -- It is enabled with the prefix 'modules' in the project manager entry field. module('textadept.pm.browsers.modules', package.seeall) +textadept.pm.add_browser('modules') + local lfs = require 'lfs' local os = require 'os' diff --git a/core/ext/pm/project_browser.lua b/core/ext/pm/project_browser.lua index 8c99194c..b1609ad1 100644 --- a/core/ext/pm/project_browser.lua +++ b/core/ext/pm/project_browser.lua @@ -7,6 +7,8 @@ local textadept = _G.textadept -- It is enabled with the prefix 'project' in the project manager entry field. module('textadept.pm.browsers.project', package.seeall) +textadept.pm.add_browser('project') + local lfs = require 'lfs' local os = require 'os' diff --git a/core/locale.lua b/core/locale.lua index 20895638..573b25be 100644 --- a/core/locale.lua +++ b/core/locale.lua @@ -325,25 +325,6 @@ MENU_VIEW_GROW = '_Grow' -- _Shrink MENU_VIEW_SHRINK = '_Shrink' --- _Project Manager -MENU_PM_TITLE = '_Project Manager' --- _Toggle Visible -MENU_PM_TOGGLE_VISIBLE = '_Toggle Visible' --- _Focus -MENU_PM_FOCUS = '_Focus' --- Show _Project -MENU_PM_PROJECT = 'Show _Project' --- Show _CTags -MENU_PM_CTAGS = 'Show _CTags' --- Show _Buffers -MENU_PM_BUFFERS = 'Show _Buffers' --- Show _Files -MENU_PM_FILES = 'Show _Files' --- Show _Macros -MENU_PM_MACROS = 'Show _Macros' --- Show Mo_dules -MENU_PM_MODULES = 'Show Mo_dules' - -- _Lexers MENU_LEX_TITLE = '_Lexers' |