-
Notifications
You must be signed in to change notification settings - Fork 815
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEAT] TextArea relative line numbers #3382
Comments
I appreciate this feature request might be too niche. I've hacked together a custom class RnuTextArea(TextArea):
relative_numbers: Reactive[bool] = reactive(False)
@override
def render_line(self, widget_y: int) -> Strip:
# --snip--
if not self.relative_numbers or line_index == cursor_row:
line_number = line_index + 1
else:
line_number = abs(cursor_row - line_index)
gutter = Text(
f"{line_number:>{gutter_width_no_margin}} ",
style=gutter_style or "",
end="",
)
# --snip-- |
Closing as stale as there doesn't seem to be any appetite for this. |
Don't forget to star the repository! Follow @textualizeio for Textual updates. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sorry, I'm going to bite the bullet and make the first feature request for the new
TextArea
!Would you consider adding an option for relative/hybrid line numbers?
The text was updated successfully, but these errors were encountered: