Home » U++ TheIDE » U++ TheIDE: CodeEditor, Assist++, Topic++ » How to duplicate line.
How to duplicate line. [message #43582] |
Sun, 07 September 2014 00:41 |
|
It's very useful to press Ctrl+D to duplicate line in codeeditor.
Maybe one of next release TheIde You can add this hot key?
SergeyNikitin<U++>( linux, wine )
{
under( Ubuntu || Debian || Raspbian );
}
|
|
|
|
Re: How to duplicate line. [message #43671 is a reply to message #43663] |
Fri, 19 September 2014 07:05 |
|
Thanks.
(I use many an ide at the same time (for Java, js, a python... ) and it is very convenient to have the single hot key as Ctrl+D or Ctrl+2
to copy a line. Possibly we to make the hot keys similar? )
Thanks. I will try to use.
SergeyNikitin<U++>( linux, wine )
{
under( Ubuntu || Debian || Raspbian );
}
|
|
|
|
Re: How to duplicate line. [message #43681 is a reply to message #43679] |
Fri, 19 September 2014 22:22 |
|
Klugier
Messages: 1083 Registered: September 2012 Location: Poland, Kraków
|
Senior Contributor |
|
|
Hello Mirek,
I think that current implementetion dosen't work as good as it can. So correct implementation should look like this (Pleace notice that I don't know that it dosen't break rectangular selection):
void TextCtrl::Copy()
{
WString txt;
int l, h;
if(!GetSelection(l, h) && !IsAnySelection()) {
int i = GetLine(cursor);
l = GetPos(i);
h = l + line[i].GetLength();
txt = "\n";
}
if(IsRectSelection())
txt = CopyRectSelection();
else
txt += GetW(l, h - l);
ClearClipboard();
AppendClipboardUnicodeText(txt);
AppendClipboardText(txt.ToString());
}
// File CtrlLib/Text.cpp
New line is genereting by adding simply assignment. One thing is important here, we cannot add + 1 to h local variable, beacuse we don't want to copy line ending new line!!! Can you check this and review this code?
P.S.
It seems that Text.cpp file needs code standarization, because all function opening brakets beggining in the same line where the function name is. More in diff... This implementation works exactly the same like this in Notepad++ (CTRL+D) or Visual Studio(CTRL+C + CTRL+V).
Sincerely,
Klugier
U++ - one framework to rule them all.
[Updated on: Sat, 20 September 2014 12:46] Report message to a moderator
|
|
|
|
|
|
Goto Forum:
Current Time: Fri Nov 01 02:01:58 CET 2024
Total time taken to generate the page: 0.03166 seconds
|