diff options
author | nyamatongwe <devnull@localhost> | 2004-01-02 01:03:52 +0000 |
---|---|---|
committer | nyamatongwe <devnull@localhost> | 2004-01-02 01:03:52 +0000 |
commit | d0b523880e49825674136d69ca3e846a81270860 (patch) | |
tree | 34724030f01be218f14e42f994d110d50d1b3aec | |
parent | b56b94ffa5b927b759809e983e0e5f351314f9d2 (diff) | |
download | scintilla-mirror-d0b523880e49825674136d69ca3e846a81270860.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 |