diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-03-27 14:18:06 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-03-27 14:18:41 +0200 |
commit | db7f835c320632ec4dea3b8baf5e21b62e2b75e1 (patch) | |
tree | bc0d497c8152b55b04c62fccb98d394ff8cd57fa /src/ui/text.c | |
parent | 2a4f5d0f67fcd1412968ef967ed3009469a46b90 (diff) |
DocumentWidget: Advanced text selection
Double click to select by word, triple click by paragraph.
IssueID #134
Diffstat (limited to 'src/ui/text.c')
-rw-r--r-- | src/ui/text.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ui/text.c b/src/ui/text.c index 80d3634c..6aaf40f5 100644 --- a/src/ui/text.c +++ b/src/ui/text.c | |||
@@ -649,7 +649,7 @@ static iChar nextChar_(const char **chPos, const char *end) { | |||
649 | return 0; | 649 | return 0; |
650 | } | 650 | } |
651 | iChar ch; | 651 | iChar ch; |
652 | int len = decodeBytes_MultibyteChar(*chPos, end - *chPos, &ch); | 652 | int len = decodeBytes_MultibyteChar(*chPos, end, &ch); |
653 | if (len <= 0) { | 653 | if (len <= 0) { |
654 | (*chPos)++; /* skip it */ | 654 | (*chPos)++; /* skip it */ |
655 | return 0; | 655 | return 0; |
@@ -862,6 +862,7 @@ static iRect run_Font_(iFont *d, const iRunArgs *args) { | |||
862 | const enum iRunMode mode = args->mode; | 862 | const enum iRunMode mode = args->mode; |
863 | const char * lastWordEnd = args->text.start; | 863 | const char * lastWordEnd = args->text.start; |
864 | iAssert(args->xposLimit == 0 || isMeasuring_(mode)); | 864 | iAssert(args->xposLimit == 0 || isMeasuring_(mode)); |
865 | iAssert(args->text.end >= args->text.start); | ||
865 | if (args->continueFrom_out) { | 866 | if (args->continueFrom_out) { |
866 | *args->continueFrom_out = args->text.end; | 867 | *args->continueFrom_out = args->text.end; |
867 | } | 868 | } |