diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-09-09 12:13:40 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-09-09 12:13:40 +0300 |
commit | 3fefa6cd9a0445fb430035766951c647a3b250f4 (patch) | |
tree | 12a1d08effcdaef6957607efa513182024b03118 /src/ui/inputwidget.c | |
parent | b2e929c9fb31933cd4aeef841447c7db88db234c (diff) |
InputWidget: Mark range out of bounds
Apparently after some sequence of edits/navigation, the URL input's selected range ended up out of bounds. Probably it isn't being cleared everywhere it should be.
Diffstat (limited to 'src/ui/inputwidget.c')
-rw-r--r-- | src/ui/inputwidget.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ui/inputwidget.c b/src/ui/inputwidget.c index 8f5a0656..89981bd2 100644 --- a/src/ui/inputwidget.c +++ b/src/ui/inputwidget.c | |||
@@ -307,7 +307,10 @@ void setNotifyEdits_InputWidget(iInputWidget *d, iBool notifyEdits) { | |||
307 | } | 307 | } |
308 | 308 | ||
309 | static iRanges mark_InputWidget_(const iInputWidget *d) { | 309 | static iRanges mark_InputWidget_(const iInputWidget *d) { |
310 | return (iRanges){ iMin(d->mark.start, d->mark.end), iMax(d->mark.start, d->mark.end) }; | 310 | iRanges m = { iMin(d->mark.start, d->mark.end), iMax(d->mark.start, d->mark.end) }; |
311 | m.start = iMin(m.start, size_Array(&d->text)); | ||
312 | m.end = iMin(m.end, size_Array(&d->text)); | ||
313 | return m; | ||
311 | } | 314 | } |
312 | 315 | ||
313 | static void contentsWereChanged_InputWidget_(iInputWidget *d) { | 316 | static void contentsWereChanged_InputWidget_(iInputWidget *d) { |