aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/ext/key_commands.lua1
-rw-r--r--core/ext/menu.lua4
-rw-r--r--core/locale.lua2
-rw-r--r--modules/textadept/editing.lua20
4 files changed, 1 insertions, 26 deletions
diff --git a/core/ext/key_commands.lua b/core/ext/key_commands.lua
index f8110e4c..5d9d7f17 100644
--- a/core/ext/key_commands.lua
+++ b/core/ext/key_commands.lua
@@ -77,7 +77,6 @@ if not MAC then
c = { m_editing.enclose, 'chars' },
}
keys.as = { -- select in...
- e = { m_editing.select_enclosed },
t = { m_editing.select_enclosed, 'tags' },
['"'] = { m_editing.select_enclosed, 'dbl_quotes' },
["'"] = { m_editing.select_enclosed, 'sng_quotes' },
diff --git a/core/ext/menu.lua b/core/ext/menu.lua
index 3f91ab2b..edddae77 100644
--- a/core/ext/menu.lua
+++ b/core/ext/menu.lua
@@ -56,7 +56,6 @@ local ID = {
ENCLOSE_IN_BRACES = 230,
ENCLOSE_IN_CHARACTER_SEQUENCE = 231,
GROW_SELECTION = 232,
- SELECT_IN_STRUCTURE = 233,
SELECT_IN_HTML_TAG = 234,
SELECT_IN_DOUBLE_QUOTE = 235,
SELECT_IN_SINGLE_QUOTE = 236,
@@ -241,7 +240,6 @@ t.menubar = {
{ l.MENU_EDIT_SEL_GROW, ID.GROW_SELECTION },
},
{ title = l.MENU_EDIT_SEL_IN_TITLE,
- { l.MENU_EDIT_SEL_IN_STRUCTURE, ID.SELECT_IN_STRUCTURE },
{ l.MENU_EDIT_SEL_IN_HTML_TAG, ID.SELECT_IN_HTML_TAG },
{ l.MENU_EDIT_SEL_IN_DOUBLE_QUOTE, ID.SELECT_IN_DOUBLE_QUOTE },
{ l.MENU_EDIT_SEL_IN_SINGLE_QUOTE, ID.SELECT_IN_SINGLE_QUOTE },
@@ -472,7 +470,6 @@ local actions = {
-- Edit -> Selection
[ID.GROW_SELECTION] = { m_editing.grow_selection, 1 },
-- Edit -> Select In...
- [ID.SELECT_IN_STRUCTURE] = { m_editing.select_enclosed },
[ID.SELECT_IN_HTML_TAG] = { m_editing.select_enclosed, 'tags' },
[ID.SELECT_IN_DOUBLE_QUOTE] = { m_editing.select_enclosed, 'dbl_quotes' },
[ID.SELECT_IN_SINGLE_QUOTE] = { m_editing.select_enclosed, 'sng_quotes' },
@@ -587,6 +584,7 @@ t.events.add_handler('menu_clicked',
end
end)
+-- Right-click context menu.
t.context_menu = gtkmenu {
{ l.MENU_EDIT_UNDO, ID.UNDO },
{ l.MENU_EDIT_REDO, ID.REDO },
diff --git a/core/locale.lua b/core/locale.lua
index 7b584a5c..bf60f99a 100644
--- a/core/locale.lua
+++ b/core/locale.lua
@@ -210,8 +210,6 @@ MENU_EDIT_SEL_ENC_CHAR_SEQ = '_Character Sequence'
MENU_EDIT_SEL_GROW = '_Grow'
-- Select i_n...
MENU_EDIT_SEL_IN_TITLE = 'Select i_n...'
--- S_tructure
-MENU_EDIT_SEL_IN_STRUCTURE = 'S_tructure'
-- _HTML Tag
MENU_EDIT_SEL_IN_HTML_TAG = '_HTML Tag'
-- _Double Quote
diff --git a/modules/textadept/editing.lua b/modules/textadept/editing.lua
index a7c0e674..545f2e52 100644
--- a/modules/textadept/editing.lua
+++ b/modules/textadept/editing.lua
@@ -490,26 +490,6 @@ function select_enclosed(str)
local s = buffer:search_prev(0, enclosure[str].left)
local e = buffer:search_next(0, enclosure[str].right)
if s and e then buffer:set_sel(s + 1, e) end
- else
- -- TODO: ignore enclosures in comment scopes?
- s, e = buffer.anchor, buffer.current_pos
- if s > e then s, e = e, s end
- local char = string.char(buffer.char_at[s - 1])
- if s ~= e and char_matches[char] then
- s, e = s - 2, e + 1 -- don't match the same enclosure
- end
- while s >= 0 do
- char = string.char(buffer.char_at[s])
- if char_matches[char] then
- buffer.target_start, buffer.target_end = e, buffer.length
- buffer.search_flags = 0
- if buffer:search_in_target(char_matches[char]) ~= -1 then
- e = buffer.target_end
- end
- if e then buffer:set_sel(s + 1, e - 1) break end
- end
- s = s - 1
- end
end
end