mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-21 10:00:39 +00:00
feat: add editorPaddingX setting for input editor horizontal padding
This commit is contained in:
parent
5d3e7d5aaa
commit
fe52ff00d2
6 changed files with 46 additions and 2 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue