feat: add editorPaddingX setting for input editor horizontal padding
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
|
||||
### Added
|
||||
|
||||
- `EditorOptions` with optional `paddingX` for horizontal content padding ([#791](https://github.com/badlogic/pi-mono/pull/791) by [@ferologics](https://github.com/ferologics))
|
||||
- `EditorOptions` with optional `paddingX` for horizontal content padding, plus `getPaddingX()`/`setPaddingX()` methods ([#791](https://github.com/badlogic/pi-mono/pull/791) by [@ferologics](https://github.com/ferologics))
|
||||
|
||||
### Changed
|
||||
|
||||
|
||||
@@ -300,6 +300,18 @@ export class Editor implements Component, Focusable {
|
||||
this.paddingX = Number.isFinite(paddingX) ? Math.max(0, Math.floor(paddingX)) : 0;
|
||||
}
|
||||
|
||||
getPaddingX(): number {
|
||||
return this.paddingX;
|
||||
}
|
||||
|
||||
setPaddingX(padding: number): void {
|
||||
const newPadding = Number.isFinite(padding) ? Math.max(0, Math.floor(padding)) : 0;
|
||||
if (this.paddingX !== newPadding) {
|
||||
this.paddingX = newPadding;
|
||||
this.tui.requestRender();
|
||||
}
|
||||
}
|
||||
|
||||
setAutocompleteProvider(provider: AutocompleteProvider): void {
|
||||
this.autocompleteProvider = provider;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user