Hello, @Moosems !
First of all, I would like to thank you and all contributors for this amazing repository that's making my python text editor, Pytext, become true.
I'm opening this issue to discuss about a contribution to TkLineNums, to add tilde chars.
If you don't know what a tilde char is, I will show you an example with Vim:
The "~" chars are tilde chars. They represent non-lines in the line counter. In the current TkLineNums, tilde chars are not customizable and, if a line index is not existent, it is just ignored.
I changed your code so user can add a custom tilde char to its TkLineNums instance.
Example in my current code:
self.line_counter = TkLineNumbers(master, self, justify="right", colors=("#e3ba68", "#1D1E1E"),tilde="~", bd=0)
If user doesn't provide a tilde parameter, It will be None. In this case, TkLineNums will work normally, so projects that already use TkLineNums won't break.
def __init__(
self: TkLineNumbers,
master: Misc,
textwidget: Text,
justify: str = "left",
# None means take colors from text widget (default).
# Otherwise it is a function that takes no arguments and returns (fg, bg) tuple.
colors: Callable[[], tuple[str, str]] | tuple[str, str] | None = None,
tilde: str | None = None,
*args,
**kwargs,
) -> None:
I hope you like my idea and my contribution is already done, It just needs to pull-request. Please, tell my what do you think about this new TkLineNums functionality.
Best regards!