aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar mitchell <70453897+667e-11@users.noreply.github.com>2020-08-10 18:02:41 -0400
committerGravatar mitchell <70453897+667e-11@users.noreply.github.com>2020-08-10 18:02:41 -0400
commita88896a26d3d8d7ce5750c0942b6ea394a654edb (patch)
tree3e86289df4f2d2f4ff5bd3f083fa4909920db9c4
parenteebe21d48a1232b6575b03e0bde09bcf82c907e5 (diff)
"View > Toggle Fold" toggles folding for the current block, regardless of line.
Previously, you had to be on a line that was a fold point.
-rw-r--r--doc/manual.md4
-rw-r--r--modules/textadept/menu.lua3
2 files changed, 4 insertions, 3 deletions
diff --git a/doc/manual.md b/doc/manual.md
index a2d52098..bba60e27 100644
--- a/doc/manual.md
+++ b/doc/manual.md
@@ -802,8 +802,8 @@ selecting a lexer from the list manually sets the lexer instead. Your
Some lexers support "code folding", the act of temporarily hiding blocks of code
in order to make viewing easier. Markers in the margin to the left of the code
denote fold points. Clicking on one toggles the folding for that block of code.
-Pressing `Ctrl+*` (`⌘*` on macOS | `M-*` in the terminal) also toggles the fold
-point on the current line.
+Pressing `Ctrl+*` (`⌘*` on macOS | `M-*` in the terminal) also toggles folding
+for the current block.
![Folding](images/folding.png)
diff --git a/modules/textadept/menu.lua b/modules/textadept/menu.lua
index b17c853f..4728023e 100644
--- a/modules/textadept/menu.lua
+++ b/modules/textadept/menu.lua
@@ -317,7 +317,8 @@ local default_menubar = {
end},
SEPARATOR,
{_L['Toggle Current Fold'], function()
- view:toggle_fold(buffer:line_from_position(buffer.current_pos))
+ local line = buffer:line_from_position(buffer.current_pos)
+ view:toggle_fold(buffer.fold_parent[line])
end},
SEPARATOR,
{_L['Toggle Show Indent Guides'], function()