duplicate line/selection up/down does not work with selections
It always duplicates the entire line.
This is closed, but what exacly was the fix? If it is fixed, is there a way to get a nightly or something that includes this fix? This is a feature I use a lot (didn't even realize how much I used it until I upgraded from 8.5 and it quit working).
I think it got closed by accident? I'm not sure. Naatan? I'm not actually able to reproduce this.
- Select a line
- Ctrl + shift + up[down]
Duplicates my current selected line as expected. What platform are you on Aaron?
I'm on Ubuntu.
ctrl+shift+up/down does nothing. Looking at the key bindings, I don't see those linked to anything. Maybe that's because it imported my settings from Komodo 8?
I added the key binding of ctrl+d (pretty standard for "duplicate" in other programs) for "Editor: Duplicate Line/Selection Down" and it works for duplicating a line, but if I have a text selection it still just duplicates the line.
My mistake. I was SELECTING an entire LINE rather than just a portion. Duplicating a selection is not working for me, unless it's an entire line. Sorry for the confusion.
Duplicate a selection works fine if you select more than one line. If you just select a piece of string - Komodo will duplicate the entire line. But I don't understand how Komodo should duplicate only a portion of the line. Can you guys say what you want to see?
It should go before or after (left or right, based on the user's text direction). Just like it did in Komodo 8 with "Editor: Duplicate Line or Selection" (but I guess adding in the before/after option)
This has been long standing functionality.
~~Also, I'm not sure if it was my own bindings or default bindings that set it to CTRL+D. If it was mine, no big deal I'll just set them again. If it was default, I'm curious why that keybinding was repurposed.~~ It looks like, at least in Komodo 8, CTRL+D did not default to this, so that's not an issue.
This isnt closed, the issue this bug is referencing got closed. Github UX can be a bit weird sometimes.
Yeah, sorry, I saw that after cgchoffman's reply.
However, the change from bug to enhancement doesn't seem right. This is a regression from KomodoIDE 8 to 9.
Duplicate up/down didnt exist in Komodo 8, so it is definitely not a regression :) It sounds like you may be confusing this with another feature?
You had "Editor: Duplicate Line or Selection" which has been REPLACED with "Editor: Duplicate Line/Selection Down" and "Editor: Duplicate Line/Selection Up". I would consider it a regression because the old method worked for this but was removed in favor of these new ones, which don't work for a partial-line selection. At least I'm pretty sure it was removed as I don't see the original one anywhere, and my previous keybinding for it was free even though my other keybindings were imported.
Ctrl+D is bound to cmd_addNextWordToCaretSet and was added in Komodo 8.5 You can get the Ctrl+D functionality back by adding a macro with the following code in it
//grab the editor scimoz object
var scimoz = ko.views.manager.currentView.scimoz;
// now duplicate the selection
sicmoz.selectionDuplicate();
It won't be identical I'm sure but should work, let us know. You can then set the properties > Keybindings of the macro to Ctrl+D. That should do for a workaround for now.
Looks like we may need to revisit the implementation during Komodo 9 development and/or bring back the original code to be included as well as the new.
The macro works as expected, with one minor fix. There's a typo, sicmoz should me scimoz in the selectionDuplicate line.
//grab the editor scimoz object
var scimoz = ko.views.manager.currentView.scimoz;
// now duplicate the selection
scimoz.selectionDuplicate();
Yep, that would probably break it :dancer:
Is there any chance to modify a macro suggested by @cgchoffman and @aaroncampbell to function it a little bit different way: duplicated text should appear before (not after) selected text?
It would be perfectly the same way as Duplicate Line/Selection worked before, and as it works in WebStorm, NuSphere etc.
Is there any chance to modify a macro suggested by @cgchoffman and @aaroncampbell to function it a little bit different way: duplicated text should appear before (not after) selected text?
@thybzi please open a forum post for this http://forum.komodoide.com/
Actually, the fix I committed does this :) You can reference it if you want to create such a macro. It just involves moving the selection after duplicating the selection.
Is there something preventing this from going into the 9.3 branch? It's really my biggest frustration with KomodoIDE now, and the fix seems to be here but hasn't been made available yet.
This cannot go into 9.3.x because it was tagged as an enhancement and we cannot put enhancements into bugfix releases. Sorry :(
I would argue that this isn't an enhancement but a fix for a regression (as I mentioned in previous comments )
You had "Editor: Duplicate Line or Selection" which has been REPLACED with "Editor: Duplicate Line/Selection Down" and "Editor: Duplicate Line/Selection Up". I would consider it a regression because the old method worked for this but was removed in favor of these new ones, which don't work for a partial-line selection.