MacDownApp / MacDownApp/macdown
`Cmd+D` To Duplicate a Line
Nobody has claimed this yet.
- Dominant language
- Rich Text Format
- Stars
- 9.8k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Description
Enhancement request: Press `Cmd+D` do duplicate the line that the cursor is on.
This is a feature in most code editors and I miss it. It's useful for creating a list of repeating things.
The typical behavior is to duplicate the line that the cursor is on, putting the new line below the current one and moving the cursor to the end of the newly duplicated line. This means you can type a line and hit `Cmd+D` repeatedly to create a list of identical items.
The alternative is slow:
```
cmd+right arrow (move to end of current line)
cmd+shift+left arrow (select to beginning of line)
cmd+C (copy)
cmd+right arrow (move back to end of line without a selection)
return (new line)
cmd+V (paste)
```
...But still it's the fastest keyboard way to dupe a line without `Cmd+D`
It might seem like this competes with #280, but that only applies when there is a selection, so I think they could co-exist.
Might be able to do a PR for this, but my ObjC is limited. Point me to the right area of the code and I'll be able to tell.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue does not name a file or test; start by locating the editor's keyboard-command handling for Cmd+D and compare it with the selection behavior discussed in #280. Done means Cmd+D duplicates the cursor's line below it and places the cursor at the end of the duplicate, without changing the selected-text behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- macos, objective-c
- Domain
- desktop
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100