From 7af28ed0ae8321ec8c871f81598a0313c0dba7f6 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Sat, 18 Aug 2007 03:45:08 +0000 Subject: Addition of DelWordRightEnd by Nick Treleaven eases compatibility with common GTK+ behaviour. --- doc/ScintillaDoc.html | 4 ++++ doc/ScintillaHistory.html | 3 +++ include/Scintilla.h | 1 + include/Scintilla.iface | 3 +++ src/Editor.cxx | 7 +++++++ 5 files changed, 18 insertions(+) diff --git a/doc/ScintillaDoc.html b/doc/ScintillaDoc.html index e13b71775..7da1fd899 100644 --- a/doc/ScintillaDoc.html +++ b/doc/ScintillaDoc.html @@ -3678,10 +3678,14 @@ struct TextToFind { SCI_DELETEBACK SCI_DELETEBACKNOTLINE + + SCI_DELWORDLEFT SCI_DELWORDRIGHT + + SCI_DELWORDRIGHTEND diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index ec49e365e..2689194a5 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -305,6 +305,9 @@ Dmitry Maslov chupakabra Juan Carlos Arevalo Baeza + + + Nick Treleaven

diff --git a/include/Scintilla.h b/include/Scintilla.h index 144402ba6..757587259 100644 --- a/include/Scintilla.h +++ b/include/Scintilla.h @@ -505,6 +505,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_ZOOMOUT 2334 #define SCI_DELWORDLEFT 2335 #define SCI_DELWORDRIGHT 2336 +#define SCI_DELWORDRIGHTEND 2518 #define SCI_LINECUT 2337 #define SCI_LINEDELETE 2338 #define SCI_LINETRANSPOSE 2339 diff --git a/include/Scintilla.iface b/include/Scintilla.iface index c2e5e7cc0..dfc65f4da 100644 --- a/include/Scintilla.iface +++ b/include/Scintilla.iface @@ -1318,6 +1318,9 @@ fun void DelWordLeft=2335(,) # Delete the word to the right of the caret. fun void DelWordRight=2336(,) +# Delete the word to the right of the caret, but not the trailing non-word characters. +fun void DelWordRightEnd=2518(,) + # Cut the line containing the caret. fun void LineCut=2337(,) diff --git a/src/Editor.cxx b/src/Editor.cxx index 77e74c75e..a7aff6109 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -3933,6 +3933,7 @@ void Editor::NotifyMacroRecord(unsigned int iMessage, uptr_t wParam, sptr_t lPar case SCI_VCHOMEWRAPEXTEND: case SCI_DELWORDLEFT: case SCI_DELWORDRIGHT: + case SCI_DELWORDRIGHTEND: case SCI_DELLINELEFT: case SCI_DELLINERIGHT: case SCI_LINECOPY: @@ -4494,6 +4495,11 @@ int Editor::KeyCommand(unsigned int iMessage) { pdoc->DeleteChars(currentPos, endWord - currentPos); } break; + case SCI_DELWORDRIGHTEND: { + int endWord = pdoc->NextWordEnd(currentPos, 1); + pdoc->DeleteChars(currentPos, endWord - currentPos); + } + break; case SCI_DELLINELEFT: { int line = pdoc->LineFromPosition(currentPos); int start = pdoc->LineStart(line); @@ -7171,6 +7177,7 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { case SCI_ZOOMOUT: case SCI_DELWORDLEFT: case SCI_DELWORDRIGHT: + case SCI_DELWORDRIGHTEND: case SCI_DELLINELEFT: case SCI_DELLINERIGHT: case SCI_LINECOPY: -- cgit v1.2.3