Skip to content

feat: Add line manipulation shortcuts (Delete Line, Move Line Up/Down)#29

Merged
OlaProeis merged 2 commits intoOlaProeis:masterfrom
abcd-ca:feature/keyboard-line-manipulation
Jan 19, 2026
Merged

feat: Add line manipulation shortcuts (Delete Line, Move Line Up/Down)#29
OlaProeis merged 2 commits intoOlaProeis:masterfrom
abcd-ca:feature/keyboard-line-manipulation

Conversation

@abcd-ca
Copy link
Copy Markdown
Contributor

@abcd-ca abcd-ca commented Jan 19, 2026

Summary

  • Add Cmd/Ctrl+D to delete current line (configurable in settings)
  • Add Alt+Up/Down to move current line up/down (configurable in settings)
  • Fix line operations not working in Split mode (cursor position was being overwritten by rendered pane)
  • Fix tooltips showing "Ctrl+E" instead of "Cmd+E" on macOS
  • Add keyboard shortcut documentation
  • Add i18n translations for new shortcut settings (en, de, ja, zh_Hans)

Details

Line Manipulation

New keyboard shortcuts for common editing operations:

  • Delete Line: Removes the current line entirely, placing cursor at the same column on the next line
  • Move Line Up/Down: Swaps the current line with the line above/below

Split Mode Fix

In Split mode, the rendered pane was overwriting tab.cursor_position after the raw editor set it. This caused line operations (delete line, move line) to operate on the wrong line when editing in the raw pane. Fixed by not updating cursor_position from the rendered pane in Split mode.

macOS Tooltip Fix

View mode tooltips were hardcoded to show "Ctrl+E" on all platforms. Now uses modifier_symbol() helper to show "Cmd+E" on macOS.

Test plan

  • cargo build compiles successfully
  • Test Delete Line (Cmd+D) in Raw mode
  • Test Delete Line (Cmd+D) in Split mode - should delete line in left pane
  • Test Move Line Up/Down (Alt+Arrow) in Raw mode
  • Test Move Line Up/Down (Alt+Arrow) in Split mode
  • Hover over view mode indicator - should show "Cmd+E" on macOS, "Ctrl+E" on other platforms

- Add Cmd/Ctrl+D to delete current line
- Add Alt+Up/Down to move current line up/down
- Fix line operations not working in Split mode (cursor position was being
  overwritten by rendered pane)
- Fix tooltips showing "Ctrl+E" instead of "Cmd+E" on macOS
- Add keyboard shortcut documentation
- Add i18n translations for new shortcut settings
@abcd-ca
Copy link
Copy Markdown
Contributor Author

abcd-ca commented Jan 19, 2026

The delete line and move line are for me the killer features that allow me to be more productive – my IDE has those and it's always annoyed me that my markdown editor did not. Now it does. Now Ferrite is better than my old markdown editor and my IDE for editing MD files.

@OlaProeis
Copy link
Copy Markdown
Owner

Tested this locally and it works great! The Split mode fix is exactly what was needed - Move Line was broken there before and now it works perfectly.

Delete Line is a nice addition too, can't believe I didn't have that already.

Thanks for the solid work @abcd-ca, merging this 🎉

@OlaProeis OlaProeis merged commit cf664dd into OlaProeis:master Jan 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants