diff options
author | nyamatongwe <unknown> | 2004-01-02 01:03:52 +0000 |
---|---|---|
committer | nyamatongwe <unknown> | 2004-01-02 01:03:52 +0000 |
commit | dff585f9fda0376e5779db3b829d26f383095112 (patch) | |
tree | 34724030f01be218f14e42f994d110d50d1b3aec | |
parent | 205a9ef68a1f7c572de8e2b0fc82eb53ef0adfb4 (diff) | |
download | scintilla-mirror-dff585f9fda0376e5779db3b829d26f383095112.tar.gz |
Patch from Mick Trent to fix a problem with word selection mode
when the container has implemented an extended definition of words.
-rw-r--r-- | src/Editor.cxx | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx index 9878182c2..bc74e51bd 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -4907,7 +4907,17 @@ void Editor::ButtonMove(Point pt) { SetSelection(movePos); } else if (selectionType == selWord) { // Continue selecting by word - if (movePos >= originalAnchorPos) { // Moved forward + if (movePos == originalAnchorPos) { // Didn't move + // No need to do anything. Previously this case was lumped + // in with "Moved forward", but that can be harmful in this + // case: a handler for the NotifyDoubleClick re-adjusts + // the selection for a fancier definition of "word" (for + // example, in Perl it is useful to include the leading + // '$', '%' or '@' on variables for word selection). In this + // the ButtonMove() called via Tick() for auto-scrolling + // could result in the fancier word selection adjustment + // being unmade. + } else if (movePos > originalAnchorPos) { // Moved forward SetSelection(pdoc->ExtendWordSelect(movePos, 1), pdoc->ExtendWordSelect(originalAnchorPos, -1)); } else { // Moved backward |