Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 32 additions & 24 deletions library/tedit/TEDIT-SCREEN
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
(DEFINE-FILE-INFO PACKAGE "INTERLISP" READTABLE "INTERLISP" BASE 10)

(FILECREATED "20-Mar-2024 11:07:35" {WMEDLEY}<library>tedit>TEDIT-SCREEN.;645 189050
(FILECREATED "20-Apr-2024 22:13:48" {WMEDLEY}<library>tedit>TEDIT-SCREEN.;653 189725

:EDIT-BY rmk

:CHANGES-TO (FNS \TEDIT.DISPLAYLINE \TEDIT.RAISE.LINES)
:CHANGES-TO (FNS \TEDIT.LINES.ABOVE \TEDIT.VALID.LINES)

:PREVIOUS-DATE "20-Mar-2024 07:27:05" {WMEDLEY}<library>tedit>TEDIT-SCREEN.;644)
:PREVIOUS-DATE " 9-Apr-2024 10:25:33" {WMEDLEY}<library>tedit>TEDIT-SCREEN.;652)


(PRETTYCOMPRINT TEDIT-SCREENCOMS)
Expand Down Expand Up @@ -2442,7 +2442,9 @@
(FGETLD FIRSTDIRTYLINE LCHAR1))))])

(\TEDIT.LINES.BELOW
[LAMBDA (PREVLINE LASTCHAR PANE TEXTOBJ DONTDISPLAY) (* ; "Edited 15-Mar-2024 19:22 by rmk")
[LAMBDA (PREVLINE LASTCHAR PANE TEXTOBJ DONTDISPLAY VBOTTOM)
(* ; "Edited 9-Apr-2024 10:13 by rmk")
(* ; "Edited 15-Mar-2024 19:22 by rmk")
(* ; "Edited 23-Dec-2023 23:38 by rmk")
(* ; "Edited 17-Dec-2023 15:56 by rmk")
(* ; "Edited 14-Dec-2023 12:46 by rmk")
Expand All @@ -2456,6 +2458,8 @@
(* ;; "Also displays the lines, unless DONTDISPLAY. This is an optimization: THISLINE caches the just formatted line, doesn't have to be formatted again if it is immediately displayed. Calling it with DONTDISPLAY NIL followed by DONTDISPLAY T gives exactly the same result as calling it once with DONTDISPLAY T.")

(CL:WHEN PREVLINE
(CL:UNLESS VBOTTOM
(SETQ VBOTTOM (\TEDIT.ONSCREEN? PANE 'BOTTOM)))
(SETQ LASTCHAR (CL:IF LASTCHAR
(IMIN LASTCHAR (FGETTOBJ TEXTOBJ TEXTLEN))
(FGETTOBJ TEXTOBJ TEXTLEN)))
Expand All @@ -2467,10 +2471,9 @@
(SUB1 (FGETLD (FGETLD PREVLINE NEXTLINE)
LCHAR1))
(FGETLD PREVLINE LCHARLIM)))
(YBOT _ (FGETLD PREVLINE YBOT))
(PBOTTOM _ (fetch (REGION BOTTOM) of (DSPCLIPPINGREGION NIL PANE))) inlines PREVLINE
(YBOT _ (FGETLD PREVLINE YBOT)) inlines PREVLINE
first (CL:WHEN (OR (IGREATERP LCHARLIM LASTCHAR)
(ILEQ YBOT PBOTTOM))
(ILEQ YBOT VBOTTOM))
(FSETLD PREVLINE NEXTLINE NIL) (* ; "Eliminate dangling garbage")
(RETURN PREVLINE)) while (SETQ NEXT (\TEDIT.FORMATLINE TEXTOBJ (ADD1 LCHARLIM)))
do
Expand All @@ -2481,7 +2484,7 @@
(SETQ YBOT (\TEDIT.LINE.BOTTOM NEXT)) (* ; "Link needed for Y position")
(SETQ LCHARLIM (FGETLD NEXT LCHARLIM))
(CL:WHEN (OR (IGREATERP LCHARLIM LASTCHAR)
(ILEQ YBOT PBOTTOM))
(ILEQ YBOT VBOTTOM))
(FSETLD L NEXTLINE NIL) (* ; "Overshot, flush link")
(RETURN L))
(CL:UNLESS DONTDISPLAY (* ;
Expand Down Expand Up @@ -2546,7 +2549,8 @@
(RETURN LASTVALID])

(\TEDIT.LOWER.LINES
[LAMBDA (NEXTVALID LASTVALID PANE TEXTOBJ) (* ; "Edited 15-Mar-2024 14:40 by rmk")
[LAMBDA (NEXTVALID LASTVALID PANE TEXTOBJ) (* ; "Edited 9-Apr-2024 10:25 by rmk")
(* ; "Edited 15-Mar-2024 14:40 by rmk")
(* ; "Edited 20-Jan-2024 23:15 by rmk")
(* ; "Edited 2-Jan-2024 00:26 by rmk")
(* ; "Edited 4-Dec-2023 11:25 by rmk")
Expand All @@ -2560,9 +2564,9 @@

(* ;; "If PANE has been moved so that it is not entirely within the screen, then don't try to find the relevant bits, just repaint the whole window.")

(CL:UNLESS (\TEDIT.OFFSCREEN.SCROLL TEXTOBJ PANE 'VERTICAL)
(CL:UNLESS (\TEDIT.OFFSCREEN.SCROLL TEXTOBJ PANE 'TOP)

(* ;; "Completely on screen, we can take advantage of screen bitmap.")
(* ;; "Top is on screen, take advantage of screen bitmap. ")

[PROG ((NEWTOP (GETLD LASTVALID YBOT))
(PREG (DSPCLIPPINGREGION NIL PANE))
Expand All @@ -2575,10 +2579,10 @@

(* ;; "Make the YPOS of the lowered lines consistent with the intended positions of their images. LASTVISIBLE is the last line that was previously visible (and whose image will be lowered). ")

(for L (PBOTTOM _ (fetch BOTTOM of PREG)) inlines NEXTVALID
(for L (VBOTTOM _ (\TEDIT.ONSCREEN? PANE 'BOTTOM)) inlines NEXTVALID
while (IGEQ (IDIFFERENCE (FGETLD L YBOT)
LOWER)
PBOTTOM) do (SETQ LASTVISIBLE L))
VBOTTOM) do (SETQ LASTVISIBLE L))

(* ;; "")

Expand Down Expand Up @@ -2675,7 +2679,9 @@
(RETURN))])

(\TEDIT.VALID.LINES
[LAMBDA (TEXTOBJ FIRSTCHANGEDCHNO NCHARSCHANGED REASON) (* ; "Edited 20-Mar-2024 06:46 by rmk")
[LAMBDA (TEXTOBJ FIRSTCHANGEDCHNO NCHARSCHANGED REASON) (* ; "Edited 20-Apr-2024 22:11 by rmk")
(* ; "Edited 2-Apr-2024 10:43 by rmk")
(* ; "Edited 20-Mar-2024 06:46 by rmk")
(* ; "Edited 15-Mar-2024 19:44 by rmk")
(* ; "Edited 22-Feb-2024 01:05 by rmk")
(* ; "Edited 3-Nov-2023 12:07 by rmk")
Expand Down Expand Up @@ -2751,7 +2757,8 @@
(SETQ LASTVALIDLINE (find L backlines (FGETLD FIRSTCHANGEDLINE PREVLINE)
suchthat (FGETLD L FORCED-END)))
(CL:WHEN (AND (EQ LASTVALIDLINE PLINES)
(IGREATERP (FGETLD FIRSTCHANGEDLINE LCHAR1)
(IGREATERP (FGETLD (FGETLD LASTVALIDLINE NEXTLINE)
LCHAR1)
1))

(* ;; "We ran back to the top of the pane without finding a forced-end. If it's not the beginning of the document, we need to insert a new line with the proper LCHARLIM and YBOT just above the pane. ")
Expand All @@ -2765,7 +2772,7 @@

(* ;; "The next valid must be somewhere after the last changed line, and after a stable line break. But we will run out of lines if there is no visible paragraph break: the change reached the bottom, or the paragraph break after the change is below the pane, or the document ended. In that case the last line in the chain is not valid and presumably the gap filler will fill to the end of the window. ")

[SETQ NEXTVALIDLINE (for L inlines LASTCHANGEDLINE
[SETQ NEXTVALIDLINE (for L inlines (FGETLD LASTCHANGEDLINE NEXTLINE)
when (OR (FGETLD L FORCED-END)
(GETLD L LSTLN))
do (RETURN (FGETLD L NEXTLINE]
Expand Down Expand Up @@ -2939,9 +2946,10 @@
NEWYBOT])

(\TEDIT.NCONC.LINES
[LAMBDA (HEADLINE TAILLINE HEADYTOP LASTBOTTOM) (* ; "Edited 1-Dec-2023 11:45 by rmk")
[LAMBDA (HEADLINE TAILLINE HEADYTOP LASTBOTTOM) (* ; "Edited 8-Apr-2024 22:43 by rmk")
(* ; "Edited 1-Dec-2023 11:45 by rmk")

(* ;; "The lines headed by HEADLINE and TAILLINE are linked in a single chain, and their Y positions are adjusted so that the top of HEADLINE is at HEADYTOP (if given) and it and all other lines are positioned relative to that, based on their LHEIGHTs. If LASTBOTTOM is provided, then lines below it will be chopped off. Returns the last line in the chain.")
(* ;; "Links the lines headed by HEADLINE and TAILLINE into a single chain, and their Y positions are adjusted so that the top of HEADLINE is at HEADYTOP (if given) and it and all other lines are positioned relative to that, based on their LHEIGHTs. If LASTBOTTOM is provided, then lines below it will be chopped off. Returns the last line in the chain.")

(CL:WHEN HEADLINE
(CL:UNLESS HEADYTOP
Expand Down Expand Up @@ -2975,13 +2983,13 @@
\TEDIT.LINES.ABOVE 109664 . 111913)) (112032 114453 (\CLEARTHISLINE 112042 . 112711) (\TLVALIDATE
112713 . 114451)) (114647 134704 (\TEDIT.DISPLAYLINE 114657 . 126997) (\TEDIT.DISPLAYLINE.TABS 126999
. 129622) (\TEDIT.LINECACHE 129624 . 130352) (\TEDIT.CREATE.LINECACHE 130354 . 131190) (
\TEDIT.BLTCHAR 131192 . 133819) (\TEDIT.DIACRITIC.SHIFT 133821 . 134702)) (135319 189027 (
\TEDIT.BLTCHAR 131192 . 133819) (\TEDIT.DIACRITIC.SHIFT 133821 . 134702)) (135319 189702 (
\TEDIT.UPDATE.SCREEN 135329 . 137153) (\TEDIT.BACKFORMAT 137155 . 139197) (\TEDIT.PREVIOUS.LINEBREAK
139199 . 141502) (\TEDIT.FILLPANE 141504 . 144053) (\TEDIT.UPDATE.LINES 144055 . 149043) (
\TEDIT.CREATEPLINE 149045 . 150888) (\TEDIT.FIND.DIRTYCHARS 150890 . 152902) (\TEDIT.LINES.BELOW
152904 . 156386) (\FORMAT.GAP.LINES 156388 . 160379) (\TEDIT.LOWER.LINES 160381 . 164748) (
\TEDIT.RAISE.LINES 164750 . 168177) (\TEDIT.VALID.LINES 168179 . 177573) (\TEDIT.CLEARPANE.BELOW.LINE
177575 . 178893) (\TEDIT.INSERTLINE 178895 . 180153) (\TEDIT.INSURE.TRAILING.LINE 180155 . 181470) (
\TEDIT.MARK.LINES.DIRTY 181472 . 184183) (\TEDIT.LINE.BOTTOM 184185 . 187025) (\TEDIT.NCONC.LINES
187027 . 189025)))))
152904 . 156556) (\FORMAT.GAP.LINES 156558 . 160549) (\TEDIT.LOWER.LINES 160551 . 165013) (
\TEDIT.RAISE.LINES 165015 . 168442) (\TEDIT.VALID.LINES 168444 . 178142) (\TEDIT.CLEARPANE.BELOW.LINE
178144 . 179462) (\TEDIT.INSERTLINE 179464 . 180722) (\TEDIT.INSURE.TRAILING.LINE 180724 . 182039) (
\TEDIT.MARK.LINES.DIRTY 182041 . 184752) (\TEDIT.LINE.BOTTOM 184754 . 187594) (\TEDIT.NCONC.LINES
187596 . 189700)))))
STOP
Binary file modified library/tedit/TEDIT-SCREEN.LCOM
Binary file not shown.
Loading