Skip to content

remove redundant init functions, update godoc, and add some consts#8

Open
thaJeztah wants to merge 7 commits into
morikuni:masterfrom
thaJeztah:less_init_step1
Open

remove redundant init functions, update godoc, and add some consts#8
thaJeztah wants to merge 7 commits into
morikuni:masterfrom
thaJeztah:less_init_step1

Conversation

@thaJeztah
Copy link
Copy Markdown

@thaJeztah thaJeztah commented Mar 20, 2026

remove redundant init functions

Remove the init functions and instead set the variables directly.

touch-up godoc

  • touch-up Builder godoc
  • godoc: document per line
  • godoc: tighten-up cursor control godoc

export "esc" const

This is mostly for documentation purposes; exporting the type allows
the godoc to become visible.

define const for erase-modes

The current implementation considers erase-modes for "lines"
and "display" to be equivalent; while there's an overlap,
they have distinct values.

This patch:

  • Introduces type-aliases for each to make the lists self-describing.
    Aliases are used to remain backward-compatible.
  • Changes the EraseDisplay and EraseLine functions to use the
    corresponding type-alias.

The EraseModes struct is left in place, although it's currently
not used in the codebase itself; it's worth considering to mark
it deprecated (and recommend users to use the defined consts).

@thaJeztah thaJeztah force-pushed the less_init_step1 branch 2 times, most recently from 9537136 to a19195c Compare March 20, 2026 23:10
@thaJeztah thaJeztah marked this pull request as draft March 21, 2026 11:09
Remove the init functions and instead set the variables directly.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah changed the title remove redundant init functions and update godoc remove redundant init functions, update godoc, and add some consts Mar 22, 2026
@thaJeztah thaJeztah marked this pull request as ready for review March 22, 2026 18:25
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This is mostly for documentation purposes; exporting the type allows
the godoc to become visible.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
The current implementation considers erase-modes for "lines"
and "display" to be equivalent; while there's an overlap,
they have distinct values.

This patch:

- Introduces type-aliases for each to make the lists self-describing.
  Aliases are used to remain backward-compatible.
- Changes the EraseDisplay and EraseLine functions to use the
  corresponding type-alias.

The EraseModes struct is left in place, although it's currently
not used in the codebase itself; it's worth considering to mark
it deprecated (and recommend users to use the defined consts).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant