aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-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()