Skip to content

Learn keys: support Ctrl/Meta/Shift modifiers#5028

Closed
ilia-maslakov wants to merge 15 commits into
MidnightCommander:masterfrom
ilia-maslakov:il7_learn_with_modifiers
Closed

Learn keys: support Ctrl/Meta/Shift modifiers#5028
ilia-maslakov wants to merge 15 commits into
MidnightCommander:masterfrom
ilia-maslakov:il7_learn_with_modifiers

Conversation

@ilia-maslakov
Copy link
Copy Markdown

Proposed changes

  • Resolves: #...

Checklist

👉 Our coding style can be found here: https://midnight-commander.org/coding-style/ 👈

  • I have referenced the issue(s) resolved by this PR (if any)
  • I have signed-off my contribution with git commit --amend -s
  • Lint and unit tests pass locally with my changes (make indent && make check)
  • I have added tests that prove my fix is effective or that my feature works
  • I have added the necessary documentation (if appropriate)

Implement block folding for the internal editor with bracket-scope
detection ({, [, () and visual indicators in the line state area.

Features:
- Fold/unfold via gutter click, menu (Command > Fold / Unfold block),
  or keyboard shortcut (Alt+Shift+F)
- Gutter indicators configurable via skin (fold-open-char, fold-close-char)
- Smart fold: unfolds if on folded line, folds selection if selected,
  otherwise finds bracket scope and folds it
- Fold display preserves original line content with appended fold info
  showing matching bracket and line count
- Only lines with unmatched opening brackets show the fold indicator,
  avoiding noise from single-line constructs like for() or array[i]
Extract edit_fold_toggle() into fold.c for better modularity.

Prevent cursor from entering folded regions for arrow keys, End key,
and mouse clicks, similar to how tab characters prevent mid-tab cursor
placement. Right/Left arrows skip over the fold indicator ({...}) as
a single unit, respecting the cursor_beyond_eol setting.

Fix fold toggle to continue searching for multi-line brackets when
a single-line match like () is found first.

Simplify fold indicator from translated "...} (N lines)" to "...}"
for consistent width calculation.
Cover fold creation, lookup, removal, visibility checks, navigation,
line insert/delete adjustments, sorted order, and indicator width.
…fold_block

editor: Add code folding with bracket-scope detection and visual fold indicators
gh pr/issue edit --remove-label fails with exit code 1 when the
label is not assigned. Add || true to prevent workflow failures.
…gins

Panel Plugin Framework: dynamic loading and new panel plugins
Enabled blank issues and removed contact links.
Extend Learn keys to support modifier-aware sequence training and persistence.

- add Ctrl / Meta (Alt) / Shift toggles in Learn keys
- apply selected modifiers to the learned key code when defining sequences
- store learned terminal mappings using modifier-prefixed key names
  (for example: shift-up, ctrl-f9, meta-right)
- update key check logic so learned keys are validated with selected modifiers
- adjust dialog layout to keep modifier controls and help text separate
Add unit tests for modifier-aware key name generation in learn module.

- add tests/src/learn_modifiers.c
- cover none/single/combined modifier combinations
- register learn_modifiers test in tests/src/Makefile.am
@github-actions github-actions Bot added needs triage Needs triage by maintainers prio: medium Has the potential to affect progress labels Feb 27, 2026
@github-actions github-actions Bot added this to the Future Releases milestone Feb 27, 2026
@ilia-maslakov
Copy link
Copy Markdown
Author

Closing to resubmit a cleaned branch.

@github-actions github-actions Bot removed this from the Future Releases milestone Feb 27, 2026
@zyv
Copy link
Copy Markdown
Member

zyv commented May 9, 2026

Superseded by #5029.

@zyv zyv added area: core Issues not related to a specific subsystem and removed needs triage Needs triage by maintainers labels May 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: core Issues not related to a specific subsystem prio: medium Has the potential to affect progress

Development

Successfully merging this pull request may close these issues.

2 participants