From 720734fe8d17e760216d1127a0ae440204826c03 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Sun, 17 Nov 2002 03:21:17 +0000 Subject: =?UTF-8?q?Jakub=20Vr=C3=A1na=20has=20added=20a=20CSS=20(Cascading?= =?UTF-8?q?=20Style=20Sheet)=20lexer=20to=20Scintilla.=20This=20is=20separ?= =?UTF-8?q?ate=20to=20the=20HTML=20lexer=20and=20is=20only=20invoked=20for?= =?UTF-8?q?=20stand-alone=20CSS=20files,=20not=20for=20the=20STYLE=20secti?= =?UTF-8?q?on=20of=20HTML=20files.=20He=20also=20made=20some=20other=20add?= =?UTF-8?q?itions.=20There=20is=20a=20Line=20Duplicate=20command=20which?= =?UTF-8?q?=20is=20bound=20to=20Ctrl+D.=20PHP=20lexing=20has=20been=20impr?= =?UTF-8?q?oved.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Editor.cxx | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/Editor.cxx') diff --git a/src/Editor.cxx b/src/Editor.cxx index 76ba18565..2af278b19 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -3134,6 +3134,7 @@ void Editor::NotifyMacroRecord(unsigned int iMessage, unsigned long wParam, long case SCI_LINECUT: case SCI_LINEDELETE: case SCI_LINETRANSPOSE: + case SCI_LINEDUPLICATE: case SCI_LOWERCASE: case SCI_UPPERCASE: case SCI_LINESCROLLDOWN: @@ -3234,6 +3235,22 @@ void Editor::LineTranspose() { } } +void Editor::LineDuplicate() { + int line = pdoc->LineFromPosition(currentPos); + int start = pdoc->LineStart(line); + int end = pdoc->LineEnd(line); + char *thisLine = CopyRange(start, end); + const char *eol = "\n"; + if (pdoc->eolMode == SC_EOL_CRLF) { + eol = "\r\n"; + } else if (pdoc->eolMode == SC_EOL_CR) { + eol = "\r"; + } + pdoc->InsertString(end, eol); + pdoc->InsertString(end + strlen(eol), thisLine, end - start); + delete []thisLine; +} + void Editor::CancelModes() {} void Editor::NewLine() { @@ -3518,6 +3535,9 @@ int Editor::KeyCommand(unsigned int iMessage) { case SCI_LINETRANSPOSE: LineTranspose(); break; + case SCI_LINEDUPLICATE: + LineDuplicate(); + break; case SCI_LOWERCASE: ChangeCaseOfSelection(false); break; @@ -5665,6 +5685,7 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { case SCI_LINECUT: case SCI_LINEDELETE: case SCI_LINETRANSPOSE: + case SCI_LINEDUPLICATE: case SCI_LOWERCASE: case SCI_UPPERCASE: case SCI_LINESCROLLDOWN: -- cgit v1.2.3