summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Kochmański <daniel@turtleware.eu>2023-12-15 15:24:10 +0100
committerDaniel Kochmański <daniel@turtleware.eu>2023-12-23 20:42:42 +0100
commit25c4694158324bc88f55525e7954a142bffc4ba2 (patch)
tree47d573d005bb84dd39250417b50ed736e4784128
parentd7a0277ae64805e8f63c8b9c75868aaf1d02d50f (diff)
utils: break-lines: allow for a break-strategy :NONE
-rw-r--r--Core/clim-core/system/utilities.lisp8
1 files changed, 7 insertions, 1 deletions
diff --git a/Core/clim-core/system/utilities.lisp b/Core/clim-core/system/utilities.lisp
index 80703bae..65f990bf 100644
--- a/Core/clim-core/system/utilities.lisp
+++ b/Core/clim-core/system/utilities.lisp
@@ -254,6 +254,12 @@ index being halfway between INDEX-1 and INDEX-2."
(#\newline :hard)
(#\space :soft)
(otherwise nil))))
+ ((eql :none)
+ (lambda (string start index)
+ (declare (ignore start))
+ (case (char string index)
+ (#\newline :hard)
+ (otherwise nil))))
;; In case of sequences we assume
;; that the string is a single line
;; without any hard line breaks
@@ -326,7 +332,7 @@ COUNT specifies how many breaks we want to collect."
(when (and count (zerop count))
(return-from line-breaks))
;; Margin explicitly specified as NIL (break only on hard breaks).
- (when (null margin)
+ (when (or (null margin) (eq break-strategy :none))
(collect (break-line)
(loop (multiple-value-bind (index break)
(line-end string break-fn start end t)