aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Editor.cxx
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2002-11-17 03:21:17 +0000
committernyamatongwe <devnull@localhost>2002-11-17 03:21:17 +0000
commita77e6114d5f88b32e2abb8f3bcb58e583b0a4fe0 (patch)
treef8016351fc37db822f86bdb13158ac648d4a1954 /src/Editor.cxx
parentf3c7458a480cd229e7273da85291c74f50847ee6 (diff)
downloadscintilla-mirror-a77e6114d5f88b32e2abb8f3bcb58e583b0a4fe0.tar.gz
Jakub Vrána has added a CSS (Cascading Style Sheet) lexer to Scintilla.
This is separate to the HTML lexer and is only invoked for stand-alone CSS files, not for the STYLE section of HTML files. He also made some other additions. There is a Line Duplicate command which is bound to Ctrl+D. PHP lexing has been improved.
Diffstat (limited to 'src/Editor.cxx')
-rw-r--r--src/Editor.cxx21
1 files changed, 21 insertions, 0 deletions
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: