Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

On last line of file, Duplicate clones text within line instead of adding new line #926

Closed
peterflynn opened this issue May 23, 2012 · 6 comments

Comments

@peterflynn
Copy link
Member

  1. Open a file where the last line does not have a trailing CR (i.e. where the last numbered line is not blank)
  2. Put the cursor on that line
  3. Ctrl+D

Result: The text on the line is doubled (e.g. "abc;" -> "abc;abc;"). No new lines are added.

Expected: A new line is added cloning the line with the cursor on it, just like Ctrl+D on any earlier line in the file. This is how other editors work.

@ghost ghost assigned peterflynn May 23, 2012
@peterflynn
Copy link
Member Author

Note: Should add a unit test in EditorCommandHandlers-test whenever this bug is fixed.

@pthiess
Copy link
Contributor

pthiess commented May 29, 2012

Reviewed- leave it open.

@glortho
Copy link

glortho commented Jun 26, 2012

Oy, the codemirror.js code needs serious help. Frequently called anonymous functions with nested function definitions inside them, for starters. Double whammy. Is it fair game to modify this code or would we need to patch it through external overrides/scrubbing since it's third party?

@peterflynn
Copy link
Member Author

@jedverity: We generally try to keep churn to CodeMirror low. We're also trying to move to a workflow where we submit changes to the main CodeMirror repo first, then pull them into Brackets.

However, for this particular bug the behavior in question is implemented in Brackets code: EditorCommandHandlers.js. So I don't think any CodeMirror changes should be necessary.

@glortho
Copy link

glortho commented Jun 26, 2012

Understood, @peterflynn – just seeing where our boundaries are. I'll push the fix for this today (after going through the other contributor pre-reqs).

peterflynn added a commit that referenced this issue Jul 13, 2012
Fix bug #926: amend duplicateText() to handle end-of-file scenarios, with unit test
@peterflynn
Copy link
Member Author

I already confirmed this when testing the pull request, so closing straight away

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants