diff options
| author | Nicolas Dufour <nicoduf@yahoo.fr> | 2013-05-12 10:17:52 +0000 |
|---|---|---|
| committer | JazzyNico <nicoduf@yahoo.fr> | 2013-05-12 10:17:52 +0000 |
| commit | 82465b56df4a05ed0941f612ba52f5152adc5292 (patch) | |
| tree | bfdd749133a395478ce7e91413c38e958fcc175d /src/text-context.cpp | |
| parent | Fix for 871563 : JPG images are recompressed with lower quality when embedded (diff) | |
| download | inkscape-82465b56df4a05ed0941f612ba52f5152adc5292.tar.gz inkscape-82465b56df4a05ed0941f612ba52f5152adc5292.zip | |
Fix for Bug #515267 (CTRL+DEL and CTRL+BACKSPACE in text boxes doesn't work)
Fixed bugs:
- https://launchpad.net/bugs/515267
(bzr r12326)
Diffstat (limited to 'src/text-context.cpp')
| -rw-r--r-- | src/text-context.cpp | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/src/text-context.cpp b/src/text-context.cpp index d137b673d..ae2d65836 100644 --- a/src/text-context.cpp +++ b/src/text-context.cpp @@ -948,13 +948,21 @@ static gint sp_text_context_root_handler(SPEventContext *const event_context, Gd bool noSelection = false; - if (tc->text_sel_start == tc->text_sel_end) { - tc->text_sel_start.prevCursorPosition(); + if (MOD__CTRL(event)) { + tc->text_sel_start = tc->text_sel_end; + } + + if (tc->text_sel_start == tc->text_sel_end) { + if (MOD__CTRL(event)) { + tc->text_sel_start.prevStartOfWord(); + } else { + tc->text_sel_start.prevCursorPosition(); + } noSelection = true; } - iterator_pair bspace_pair; - bool success = sp_te_delete(tc->text, tc->text_sel_start, tc->text_sel_end, bspace_pair); + iterator_pair bspace_pair; + bool success = sp_te_delete(tc->text, tc->text_sel_start, tc->text_sel_end, bspace_pair); if (noSelection) { if (success) { @@ -982,8 +990,16 @@ static gint sp_text_context_root_handler(SPEventContext *const event_context, Gd if (tc->text) { bool noSelection = false; + if (MOD__CTRL(event)) { + tc->text_sel_start = tc->text_sel_end; + } + if (tc->text_sel_start == tc->text_sel_end) { - tc->text_sel_end.nextCursorPosition(); + if (MOD__CTRL(event)) { + tc->text_sel_end.nextEndOfWord(); + } else { + tc->text_sel_end.nextCursorPosition(); + } noSelection = true; } |
