You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit bc125e3
Browse filesBrowse the repository at this point in the historyBrowse files
Terminal: clear the wrap mark on erase, paint a selection whole
The mark that says a line runs on to the next (set when the terminal
folds a line at the margin) could only be set, never cleared. A program
that draws its own screen erases a row before it draws it again, and a
row that was folded in one frame is a row of its own in the next; the
stale mark then joined unrelated rows when copying. The mark now comes
off when what ran on to the margin is erased or moved off it: erasing
to the end of the line, as xterm and Ghostty do, erasing characters as
far as the margin (Ghostty clears it on any such erase), or deleting
characters (xterm). Writing over part of the line leaves it, since the
line still runs on. Setting or clearing the mark tells snapshots,
so a reader sees it without another change to the line.
ITerminalTextData gains clearWrappedLine, a default method.
The selection colour was drawn only where text was drawn, leaving the
cells past the last character on a line and the gaps under narrow
glyphs in the ordinary colours. The selected range on each line is now
filled first.
The canvas is created with NO_REDRAW_RESIZE, which repaints only what a
resize uncovers; when the grid got narrower, what was drawn in the
columns now past its edge stayed on screen until something else
repainted it. A narrower grid now redraws. And a drag that goes past
the top or bottom edge keeps scrolling while the pointer stays there,
so a selection can reach beyond the visible page, by characters, words
or lines as the drag began.
ITerminalTextData.clearWrappedLine is a new default method
(@SInCE 1.2), within the 1.2.0 bundle and the 1.1.0
org.eclipse.terminal.model export that master already has.
Copy file name to clipboardExpand all lines: terminal/bundles/org.eclipse.terminal.control/src/org/eclipse/terminal/internal/emulator/VT100EmulatorBackend.java
Copy file name to clipboardExpand all lines: terminal/bundles/org.eclipse.terminal.control/src/org/eclipse/terminal/internal/model/SynchronizedTerminalTextData.java
+5Lines changed: 5 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -157,4 +157,9 @@ synchronized public boolean isWrappedLine(int line) {
Copy file name to clipboardExpand all lines: terminal/bundles/org.eclipse.terminal.control/src/org/eclipse/terminal/internal/model/TerminalTextData.java
+7Lines changed: 7 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -340,5 +340,12 @@ public boolean isWrappedLine(int line) {
Copy file name to clipboardExpand all lines: terminal/bundles/org.eclipse.terminal.control/src/org/eclipse/terminal/internal/model/TerminalTextDataFastScroll.java
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -308,4 +308,10 @@ public void setWrappedLine(int line) {
Copy file name to clipboardExpand all lines: terminal/bundles/org.eclipse.terminal.control/src/org/eclipse/terminal/internal/model/TerminalTextDataStore.java
+5Lines changed: 5 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -394,4 +394,9 @@ public boolean isWrappedLine(int line) {
Copy file name to clipboardExpand all lines: terminal/bundles/org.eclipse.terminal.control/src/org/eclipse/terminal/internal/model/TerminalTextDataWindow.java
+7Lines changed: 7 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -267,4 +267,11 @@ public void setWrappedLine(int line) {
Copy file name to clipboardExpand all lines: terminal/bundles/org.eclipse.terminal.control/src/org/eclipse/terminal/internal/textcanvas/TextCanvas.java
+55-14Lines changed: 55 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -58,6 +58,9 @@ public class TextCanvas extends GridCanvas {
58
58
privatefinalILinelRendererfCellRenderer;
59
59
privatebooleanfScrollLock;
60
60
privatePointfDraggingStart;
61
+
/** -1 above the top, 1 below the bottom, 0 while the pointer is inside */
62
+
privatebooleanfDragScrolling;
63
+
privatestaticfinalintDRAG_SCROLL_INTERVAL = 60;
61
64
privatePointfDraggingEnd;
62
65
privatebooleanfHasSelection;
63
66
privateResizeListenerfResizeListener;
@@ -270,21 +273,13 @@ public void mouseUp(MouseEvent e) {
270
273
});
271
274
addMouseMoveListener(e -> {
272
275
if (fDraggingStart != null) {
273
-
Pointcurr = screenPointToCell(e.x, e.y);
274
-
updateHasSelection(e);
275
-
switch (fSelMode) {
276
-
caseWORD:
277
-
updateWordSelection(curr);
278
-
break;
279
-
caseLINE:
280
-
updateLineSelection(curr);
281
-
break;
282
-
caseDRAG:
283
-
default:
284
-
setSelection(curr);
285
-
break;
276
+
// Dragging past an edge keeps the lines beyond it coming into view.
Copy file name to clipboardExpand all lines: terminal/bundles/org.eclipse.terminal.control/src/org/eclipse/terminal/internal/textcanvas/TextLineRenderer.java
+10Lines changed: 10 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -97,6 +97,16 @@ public void drawLine(ITextCanvasModel model, GC gc, int line, int x, int y, int
97
97
setupGC(gc, style);
98
98
Pointstart = model.getSelectionStart();
99
99
Pointend = model.getSelectionEnd();
100
+
// Everything the selection covers on this line goes down first. Drawing
101
+
// it as the text is drawn leaves out whatever the text does not reach:
102
+
// the cells past the last character a program put on the line, and the
103
+
// cells where the font draws a glyph narrower than the one it sits in.
104
+
intfrom = Math.max(start.y == line ? start.x : 0, colFirst);
Copy file name to clipboardExpand all lines: terminal/tests/org.eclipse.terminal.test/src/org/eclipse/terminal/internal/emulator/VT100EmulatorBackendTest.java
+50Lines changed: 50 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1762,4 +1762,54 @@ public void testInsertAndDeleteOnHalfOfWideKeepBackground() {
0 commit comments