From d04f4e001b62795adb28aacfe910b8a263e25809 Mon Sep 17 00:00:00 2001 From: cage Date: Thu, 12 Aug 2021 22:40:49 +0200 Subject: [PATCH] - added loading module for abbreviation by default in config file. - prevented crash when teminal height was to small to fits suggetion window. --- etc/init.lisp | 4 ++++ src/text-utils.lisp | 18 +++++++++++------- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/etc/init.lisp b/etc/init.lisp index 6144322..ba31e11 100644 --- a/etc/init.lisp +++ b/etc/init.lisp @@ -41,6 +41,10 @@ (load-module "share-gemini-link.lisp") +;; abbrevation on command line + +(load-module "expand-abbrev-command-window.lisp") + ;; keybindings syntax: ;; a command is executed after a sequence of one or more keys. a key diff --git a/src/text-utils.lisp b/src/text-utils.lisp index f2af3ea..51aa2f1 100644 --- a/src/text-utils.lisp +++ b/src/text-utils.lisp @@ -516,12 +516,15 @@ lines fitted in the box (nil in this case). box-height) (+ width-so-far column-width)))))))) - (fit 0 box-height) - (values (reverse columns) - (and rest-lines-index - (<= rest-lines-index - lines-length) - rest-lines-index))))) + (if (> box-height 0) + (progn + (fit 0 box-height) + (values (reverse columns) + (and rest-lines-index + (<= rest-lines-index + lines-length) + rest-lines-index))) + nil)))) (defun box-fit-multiple-column (lines box-width box-height &key @@ -577,7 +580,8 @@ printed in the box column by column; in the example above the results are: box-width box-height)) (list columns))))) - (fit))) + (when lines + (fit)))) (defun annotated-text-symbol (a) (car a))