This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
needs to implement "Duplicate line / Selection" key bind
I'm sorry, I don't understand. There are shortcuts for duplicating lines or text selection - on my Mac they are Meta-Shift-Up and Meta-Shift-Down, which on PCs should translate to Ctrl-Shift-Up, Ctrl-Shift-Down, I think. Are they not working?
They duplicate lines, but not text selection. If there is no selection it's like a Ctrl-Shift-Up. On selection it's like Ctrl-C + Ctrl-V except for adding the selected text to buffer. P.S. This shortcut is in zend 5.5, notepad++, etc., but in other ide I have not seen it.
What version/build of Netbeans do you use? In my 6.8beta this action works for selection as well
Ok, so what exactly do you think these actions should do with text selection? Something like this: 012>345<6789 // text selection marked by > and < ... pressed Ctrl+Shift+Down 345 Is this what you want? If not please give us an example with as much details as possible. Thanks
example 1: 012>345<6789 // text selection marked by > and < ... pressed Ctrl+D (my "Duplicate line / selection" shortcut) 0123453456789 example 2: >123 456 789< ... pressed Ctrl+D 123 456 789 123 456 789 That's how it works in Zend 5.5 or notepad++ and i used to it.
Thanks for the examples.
sorry, i forgot about 3 example: 0123456789 // there is no selection ... pressed 0123456789 0123456789 // and in 2 example the result should be: 123 456 789123 456 789 ie if you select some text, then the following happens: 1. action copies the selection to the buffer 2. sets the "cursor" position to the end of selection 3. inserts the data from the buffer So to get 2 result from #5 comment the selection should be: >123 456 789 <
i really need this useful function. the action just like ctrl+d in notepad++ will be wonderful!
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue. Thanks for your cooperation, NetBeans IDE 8.2 Release Boss
This feature still doesn't exist. Yes you can duplicate line up and down, however Netbeans IDE is missing the "selected duplicate" function. Preferably to use the same hotkey as duplicate line. In other IDE's they use e.g. Ctrl+D for this (often they don't have the function to decide whether to duplicate it up or down) | = text marker position Double marker indicates selected text: text | text inside marker is selected | more text Example 1: This is a code line| (Ctrl + Shift + Down [Ctrl + D]) This is a code line (Line duplicated) Example 2: This is| a code| line (Ctrl + Shift + Down [Ctrl + D]) the line above now duplicate selected text and becomes: This is| a code| a code line Example 3: Same as example 2, but it can also copy paste newlines 123| (Ctrl + Shift + Down [Ctrl + D]) 456 789| Becomes: 123 456 789 456 789
(In reply to Martin Balin from comment #9) > This old bug may not be relevant anymore. If you can still reproduce it in > 8.2 development builds please reopen this issue. > > Thanks for your cooperation, > NetBeans IDE 8.2 Release Boss PS. happens in 8.2 as well
+1 This an essential shortcut I do not want to miss. It is useful for duplicating a small text selection in a single line as well as across multiple lines (the selection not necessary being aligned to line boundaries). Example 1, add a function parameter, JSON property (inline) or similar: void doSomething(>par1, <par2) -> void doSomething(par1, par1, par2) Then you can modify the duplicated par1 to par1a. Example 2, multiline: String result = >(code === 1) ? "found" : <"not found"; -> String result = (code === 1) ? "found" : (code === 1) ? "found" : "not found"; Then you can change the duplicated code: (code >= 2) ? "maybe" : If no text is selected, the assumed selection defaults to the whole line the cursor is placed in, thus equivalent to duplicating the line downwards. I know, this works this way in Notepad++ and Sublime Text. This also makes The shortcut "duplicate lines up/down" somewhat superfluous. I really would appreciate seeing this shortcut implemented in NetBeans.
Sorry, forgotten: As a work around you can use Ctrl-C Ctrl-V Ctrl-V or Ctrl-C left/right Ctrl-V. The disadvantage is: this modifies the clipboard.
This feature is badly needed. Saves time and clipboard. Everyone is already used to this shortcut (Ctrl + D) from other IDEs/editors. Thanks :)