From e468d988b369e61696608fc9ccd52c6d746cb735 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Sun, 13 Jan 2002 01:10:10 +0000 Subject: 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. --- src/Document.cxx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/Document.cxx') 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++; } -- cgit v1.2.3