diff --git a/TODO.FACTOR.txt b/TODO.FACTOR.txt index 0f483351c9..d3636a2076 100644 --- a/TODO.FACTOR.txt +++ b/TODO.FACTOR.txt @@ -76,7 +76,6 @@ + sequences -- dipping 2nmap, 2each - array sort - nappend: instead of using push, enlarge the sequence with set-length then add set the elements with set-nth diff --git a/library/ui/editors.factor b/library/ui/editors.factor index f1a6e5bd4d..d30c9cf356 100644 --- a/library/ui/editors.factor +++ b/library/ui/editors.factor @@ -33,7 +33,8 @@ TUPLE: editor line caret ; dup 0 [ + ] accumulate swap 2 v/n v+ ; : x>offset ( x font str -- offset ) - run-char-widths [ <= ] find-with drop ; + dup >r run-char-widths [ <= ] find-with drop dup -1 = + [ drop r> length ] [ r> drop ] ifte ; : set-caret-x ( x editor -- ) #! Move the caret to a clicked location.