mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-16 16:56:09 +03:00
fix build
This commit is contained in:
@ -694,7 +694,7 @@ pub fn setCursorPos(self: *Window, row: u16, col: u16) !void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn eraseDisplay(self: *Window, mode: terminal.EraseDisplay) !void {
|
pub fn eraseDisplay(self: *Window, mode: terminal.EraseDisplay) !void {
|
||||||
try self.terminal.eraseDisplay(self.alloc, mode);
|
self.terminal.eraseDisplay(mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn eraseLine(self: *Window, mode: terminal.EraseLine) !void {
|
pub fn eraseLine(self: *Window, mode: terminal.EraseLine) !void {
|
||||||
@ -706,11 +706,11 @@ pub fn deleteChars(self: *Window, count: usize) !void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn eraseChars(self: *Window, count: usize) !void {
|
pub fn eraseChars(self: *Window, count: usize) !void {
|
||||||
try self.terminal.eraseChars(self.alloc, count);
|
self.terminal.eraseChars(count);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn insertLines(self: *Window, count: usize) !void {
|
pub fn insertLines(self: *Window, count: usize) !void {
|
||||||
try self.terminal.insertLines(self.alloc, count);
|
self.terminal.insertLines(count);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn deleteLines(self: *Window, count: usize) !void {
|
pub fn deleteLines(self: *Window, count: usize) !void {
|
||||||
|
@ -346,9 +346,8 @@ pub fn setCursorPos(self: *Terminal, row: usize, col: usize) void {
|
|||||||
/// TODO: test
|
/// TODO: test
|
||||||
pub fn eraseDisplay(
|
pub fn eraseDisplay(
|
||||||
self: *Terminal,
|
self: *Terminal,
|
||||||
alloc: Allocator,
|
|
||||||
mode: csi.EraseDisplay,
|
mode: csi.EraseDisplay,
|
||||||
) !void {
|
) void {
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
.complete => {
|
.complete => {
|
||||||
const all = self.screen.getVisible();
|
const all = self.screen.getVisible();
|
||||||
@ -359,7 +358,7 @@ pub fn eraseDisplay(
|
|||||||
// All lines to the right (including the cursor)
|
// All lines to the right (including the cursor)
|
||||||
var x: usize = self.cursor.x;
|
var x: usize = self.cursor.x;
|
||||||
while (x < self.cols) : (x += 1) {
|
while (x < self.cols) : (x += 1) {
|
||||||
const cell = try self.getOrPutCell(alloc, x, self.cursor.y);
|
const cell = self.getOrPutCell(x, self.cursor.y);
|
||||||
cell.* = self.cursor.pen;
|
cell.* = self.cursor.pen;
|
||||||
cell.char = 0;
|
cell.char = 0;
|
||||||
}
|
}
|
||||||
@ -369,7 +368,7 @@ pub fn eraseDisplay(
|
|||||||
while (y < self.rows) : (y += 1) {
|
while (y < self.rows) : (y += 1) {
|
||||||
x = 0;
|
x = 0;
|
||||||
while (x < self.cols) : (x += 1) {
|
while (x < self.cols) : (x += 1) {
|
||||||
const cell = try self.getOrPutCell(alloc, x, y);
|
const cell = self.getOrPutCell(x, y);
|
||||||
cell.* = self.cursor.pen;
|
cell.* = self.cursor.pen;
|
||||||
cell.char = 0;
|
cell.char = 0;
|
||||||
}
|
}
|
||||||
@ -380,7 +379,7 @@ pub fn eraseDisplay(
|
|||||||
// Erase to the left (including the cursor)
|
// Erase to the left (including the cursor)
|
||||||
var x: usize = 0;
|
var x: usize = 0;
|
||||||
while (x <= self.cursor.x) : (x += 1) {
|
while (x <= self.cursor.x) : (x += 1) {
|
||||||
const cell = try self.getOrPutCell(alloc, x, self.cursor.y);
|
const cell = self.getOrPutCell(x, self.cursor.y);
|
||||||
cell.* = self.cursor.pen;
|
cell.* = self.cursor.pen;
|
||||||
cell.char = 0;
|
cell.char = 0;
|
||||||
}
|
}
|
||||||
@ -390,7 +389,7 @@ pub fn eraseDisplay(
|
|||||||
while (y < self.cursor.y) : (y += 1) {
|
while (y < self.cursor.y) : (y += 1) {
|
||||||
x = 0;
|
x = 0;
|
||||||
while (x < self.cols) : (x += 1) {
|
while (x < self.cols) : (x += 1) {
|
||||||
const cell = try self.getOrPutCell(alloc, x, y);
|
const cell = self.getOrPutCell(x, y);
|
||||||
cell.* = self.cursor.pen;
|
cell.* = self.cursor.pen;
|
||||||
cell.char = 0;
|
cell.char = 0;
|
||||||
}
|
}
|
||||||
@ -460,7 +459,7 @@ pub fn deleteChars(self: *Terminal, count: usize) !void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO: test, docs
|
// TODO: test, docs
|
||||||
pub fn eraseChars(self: *Terminal, alloc: Allocator, count: usize) !void {
|
pub fn eraseChars(self: *Terminal, count: usize) void {
|
||||||
// Our last index is at most the end of the number of chars we have
|
// Our last index is at most the end of the number of chars we have
|
||||||
// in the current line.
|
// in the current line.
|
||||||
const end = @minimum(self.cols, self.cursor.x + count);
|
const end = @minimum(self.cols, self.cursor.x + count);
|
||||||
@ -468,7 +467,7 @@ pub fn eraseChars(self: *Terminal, alloc: Allocator, count: usize) !void {
|
|||||||
// Shift
|
// Shift
|
||||||
var x: usize = self.cursor.x;
|
var x: usize = self.cursor.x;
|
||||||
while (x < end) : (x += 1) {
|
while (x < end) : (x += 1) {
|
||||||
const cell = try self.getOrPutCell(alloc, x, self.cursor.y);
|
const cell = self.getOrPutCell(x, self.cursor.y);
|
||||||
cell.* = self.cursor.pen;
|
cell.* = self.cursor.pen;
|
||||||
cell.char = 0;
|
cell.char = 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user