fix: small comment, error string, and guard cleanups
- Services JSDoc: "to determine" grapheme clustering wording - AttributeData: "persistent" spelling in comment - Buffer.setupTabStops: check only `undefined` (param is `number | undefined`) - SerializeAddon: fix "we must" and duplicate "the" in comment - WebglAddon: use "WebGL2" in Safari support error for consistency - TextureAtlas: "relevant" spelling in comment Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -173,7 +173,7 @@ class StringSerializeHandler extends BaseSerializeHandler {
|
|||||||
private _thisRowLastSecondChar: IBufferCell = this._buffer.getNullCell();
|
private _thisRowLastSecondChar: IBufferCell = this._buffer.getNullCell();
|
||||||
private _nextRowFirstChar: IBufferCell = this._buffer.getNullCell();
|
private _nextRowFirstChar: IBufferCell = this._buffer.getNullCell();
|
||||||
protected _rowEnd(row: number, isLastRow: boolean): void {
|
protected _rowEnd(row: number, isLastRow: boolean): void {
|
||||||
// if there is colorful empty cell at line end, whe must pad it back, or the the color block
|
// if there is colorful empty cell at line end, we must pad it back, or the color block
|
||||||
// will missing
|
// will missing
|
||||||
if (this._nullCellCount > 0 && !equalBg(this._cursorStyle, this._backgroundCell)) {
|
if (this._nullCellCount > 0 && !equalBg(this._cursorStyle, this._backgroundCell)) {
|
||||||
// use clear right to set background.
|
// use clear right to set background.
|
||||||
|
|||||||
@@ -1125,7 +1125,7 @@ function clearColor(imageData: ImageData, bg: IColor, fg: IColor, enableThreshol
|
|||||||
// were covered (fg=#8ae234, bg=#c4a000).
|
// were covered (fg=#8ae234, bg=#c4a000).
|
||||||
const threshold = Math.floor((Math.abs(r - fgR) + Math.abs(g - fgG) + Math.abs(b - fgB)) / 12);
|
const threshold = Math.floor((Math.abs(r - fgR) + Math.abs(g - fgG) + Math.abs(b - fgB)) / 12);
|
||||||
|
|
||||||
// Set alpha channel of relevent pixels to 0
|
// Set alpha channel of relevant pixels to 0
|
||||||
let isEmpty = true;
|
let isEmpty = true;
|
||||||
for (let offset = 0; offset < imageData.data.length; offset += 4) {
|
for (let offset = 0; offset < imageData.data.length; offset += 4) {
|
||||||
// Check exact match
|
// Check exact match
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ export class WebglAddon extends Disposable implements ITerminalAddon, IWebglApi
|
|||||||
};
|
};
|
||||||
const gl = document.createElement('canvas').getContext('webgl2', contextAttributes) as IWebGL2RenderingContext;
|
const gl = document.createElement('canvas').getContext('webgl2', contextAttributes) as IWebGL2RenderingContext;
|
||||||
if (!gl) {
|
if (!gl) {
|
||||||
throw new Error('Webgl2 is only supported on Safari 16 and above');
|
throw new Error('WebGL2 is only supported on Safari 16 and above');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
super();
|
super();
|
||||||
|
|||||||
@@ -204,7 +204,7 @@ export class ExtendedAttrs implements IExtendedAttrs {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Convenient method to indicate whether the object holds no additional information,
|
* Convenient method to indicate whether the object holds no additional information,
|
||||||
* that needs to be persistant in the buffer.
|
* that needs to be persistent in the buffer.
|
||||||
*/
|
*/
|
||||||
public isEmpty(): boolean {
|
public isEmpty(): boolean {
|
||||||
return this.underlineStyle === UnderlineStyle.NONE && this._urlId === 0;
|
return this.underlineStyle === UnderlineStyle.NONE && this._urlId === 0;
|
||||||
|
|||||||
@@ -578,7 +578,7 @@ export class Buffer extends Disposable implements IBuffer {
|
|||||||
* @param i The index to start setting up tab stops from.
|
* @param i The index to start setting up tab stops from.
|
||||||
*/
|
*/
|
||||||
public setupTabStops(i?: number): void {
|
public setupTabStops(i?: number): void {
|
||||||
if (i !== null && i !== undefined) {
|
if (i !== undefined) {
|
||||||
if (!this.tabs[i]) {
|
if (!this.tabs[i]) {
|
||||||
i = this.prevStop(i);
|
i = this.prevStop(i);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -324,7 +324,7 @@ export interface IOscLinkService {
|
|||||||
* bit 0: shouldJoin - should combine with preceding character.
|
* bit 0: shouldJoin - should combine with preceding character.
|
||||||
* bit 1..2: wcwidth - see UnicodeCharWidth.
|
* bit 1..2: wcwidth - see UnicodeCharWidth.
|
||||||
* bit 3..31: class of character (currently only 4 bits are used).
|
* bit 3..31: class of character (currently only 4 bits are used).
|
||||||
* This is used to determined grapheme clustering - i.e. which codepoints
|
* This is used to determine grapheme clustering - i.e. which codepoints
|
||||||
* are to be combined into a single compound character.
|
* are to be combined into a single compound character.
|
||||||
*
|
*
|
||||||
* Use the UnicodeService static function createPropertyValue to create a
|
* Use the UnicodeService static function createPropertyValue to create a
|
||||||
|
|||||||
Reference in New Issue
Block a user