KomodoEdit icon indicating copy to clipboard operation
KomodoEdit copied to clipboard

duplicate line/selection up/down does not work with selections

Open Naatan opened this issue 11 years ago • 26 comments

It always duplicates the entire line.

Naatan avatar Mar 27 '15 17:03 Naatan

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).

aaroncampbell avatar Mar 31 '15 20:03 aaroncampbell

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?

th3coop avatar Mar 31 '15 20:03 th3coop

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.

aaroncampbell avatar Mar 31 '15 20:03 aaroncampbell

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.

th3coop avatar Mar 31 '15 21:03 th3coop

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?

Defman21 avatar Mar 31 '15 21:03 Defman21

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)

aaroncampbell avatar Mar 31 '15 21:03 aaroncampbell

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.

aaroncampbell avatar Mar 31 '15 22:03 aaroncampbell

This isnt closed, the issue this bug is referencing got closed. Github UX can be a bit weird sometimes.

Naatan avatar Apr 01 '15 15:04 Naatan

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.

aaroncampbell avatar Apr 01 '15 18:04 aaroncampbell

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?

Naatan avatar Apr 01 '15 18:04 Naatan

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.

aaroncampbell avatar Apr 01 '15 21:04 aaroncampbell

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.

th3coop avatar Apr 02 '15 00:04 th3coop

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();

aaroncampbell avatar Apr 07 '15 16:04 aaroncampbell

Yep, that would probably break it :dancer:

th3coop avatar Apr 07 '15 17:04 th3coop

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.

thybzi avatar Sep 24 '15 07:09 thybzi

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/

th3coop avatar Nov 25 '15 21:11 th3coop

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.

mitchell-as avatar Nov 25 '15 22:11 mitchell-as

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.

aaroncampbell avatar Mar 30 '16 14:03 aaroncampbell

This cannot go into 9.3.x because it was tagged as an enhancement and we cannot put enhancements into bugfix releases. Sorry :(

mitchell-as avatar Mar 30 '16 15:03 mitchell-as

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.

aaroncampbell avatar Mar 30 '16 21:03 aaroncampbell