diff options
author | nyamatongwe <unknown> | 2002-01-13 01:10:10 +0000 |
---|---|---|
committer | nyamatongwe <unknown> | 2002-01-13 01:10:10 +0000 |
commit | e468d988b369e61696608fc9ccd52c6d746cb735 (patch) | |
tree | 7a1bd0b59cc23e517090aed5a2616b4f0a2126ed /src/Document.cxx | |
parent | 3e4b3fd45dfd68e74824320f909ef19c67f1b6d2 (diff) | |
download | scintilla-mirror-e468d988b369e61696608fc9ccd52c6d746cb735.tar.gz |
Added option to autocompletion AutoCSetDropRestOfWord which removes any
word characters following an insertion made by auto-completion.
Bundled the changes made by an autocompletion into one undo action.
Diffstat (limited to 'src/Document.cxx')
-rw-r--r-- | src/Document.cxx | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/Document.cxx b/src/Document.cxx index 8483d86f1..b7acc8610 100644 --- a/src/Document.cxx +++ b/src/Document.cxx @@ -722,13 +722,16 @@ Document::charClassification Document::WordCharClass(unsigned char ch) { * Used by commmands that want to select whole words. * Finds the start of word at pos when delta < 0 or the end of the word when delta >= 0. */ -int Document::ExtendWordSelect(int pos, int delta) { +int Document::ExtendWordSelect(int pos, int delta, bool onlyWordCharacters) { + charClassification ccStart = ccWord; if (delta < 0) { - charClassification ccStart = WordCharClass(cb.CharAt(pos-1)); + if (!onlyWordCharacters) + ccStart = WordCharClass(cb.CharAt(pos-1)); while (pos > 0 && (WordCharClass(cb.CharAt(pos - 1)) == ccStart)) pos--; } else { - charClassification ccStart = WordCharClass(cb.CharAt(pos)); + if (!onlyWordCharacters) + ccStart = WordCharClass(cb.CharAt(pos)); while (pos < (Length()) && (WordCharClass(cb.CharAt(pos)) == ccStart)) pos++; } |