From 3669e671c7efa0fe43028ef6390a237bae1cef24 Mon Sep 17 00:00:00 2001 From: Allan Odgaard Date: Thu, 14 Feb 2013 11:31:21 +0100 Subject: [PATCH] =?UTF-8?q?Strip=20=E2=80=9Coffset=E2=80=9D=20from=20selec?= =?UTF-8?q?tion=20string=20in=20status=20bar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Frameworks/OakTextView/src/OakTextView.mm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Frameworks/OakTextView/src/OakTextView.mm b/Frameworks/OakTextView/src/OakTextView.mm index 1f7d7bc9..a5922c0f 100644 --- a/Frameworks/OakTextView/src/OakTextView.mm +++ b/Frameworks/OakTextView/src/OakTextView.mm @@ -2159,19 +2159,23 @@ static void update_menu_key_equivalents (NSMenu* menu, action_to_key_t const& ac - (void)updateSelection { - text::selection_t ranges; + text::selection_t ranges, withoutCarry; citerate(range, editor->ranges()) { text::pos_t from = document->buffer().convert(range->first.index); text::pos_t to = document->buffer().convert(range->last.index); + if(!range->freehanded && !range->columnar) + withoutCarry.push_back(text::range_t(from, to, range->columnar)); from.offset = range->first.carry; to.offset = range->last.carry; + if(range->freehanded || range->columnar) + withoutCarry.push_back(text::range_t(from, to, range->columnar)); ranges.push_back(text::range_t(from, to, range->columnar)); } document->set_selection(ranges); isUpdatingSelection = YES; - [self setSelectionString:[NSString stringWithCxxString:ranges]]; + [self setSelectionString:[NSString stringWithCxxString:withoutCarry]]; isUpdatingSelection = NO; }