Skip to content

Commit

Permalink
feat: add WithWhitespaceBackground, WithWhitespaceForeground and With…
Browse files Browse the repository at this point in the history
…WhitespaceChars methods
  • Loading branch information
wobsoriano committed Aug 3, 2023
1 parent ee657f3 commit 8231d1e
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions src/lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ export class Style {
return this
}

// private SetStringValue(key: string, value: string) {
// symbols.SetStringValue(this.#handle, ptr(encode(key)), ptr(encode(value)))
// return this
// }
private SetStringValue(key: string, value: string) {
symbols.SetStringValue(this.#handle, ptr(encode(key)), ptr(encode(value)))
return this
}

private SetBooleanValue(key: string, value: boolean) {
symbols.SetBooleanValue(this.#handle, ptr(encode(key)), value)
Expand Down Expand Up @@ -317,6 +317,23 @@ export class Style {
MaxHeight(val: number) {
return this.SetIntValue('MaxHeight', val)
}

WithWhitespaceBackground(color: BlipglossColor) {
this.SetColorValue('WithWhitespaceBackground', color)
return this
}

WithWhitespaceForeground(color: BlipglossColor) {
this.SetColorValue('WithWhitespaceForeground', color)
return this
}

/**
* Sets the characters to be rendered in the whitespace.
*/
WithWhitespaceChars(char: string) {
return this.SetStringValue('WithWhitespaceChars', char)
}
}

export function NewStyle() {
Expand Down

0 comments on commit 8231d1e

Please sign in to comment.