Skip to content
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

Add option to display line numbers #113

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Justaphf
Copy link

Adds a user option to display simple line number prefixes in the tails display window.

Features:

  • Ability to turn on/off display of line numbers per-file config.
  • Ability to apply line number display setting to all open logs (apply all).
  • Ability to set line number display option as a global default preference for newly opened configs.
  • When turned on, line numbers draw as a right-aligned prefix to each line with ": " between the line number and line content.
    • NOTE: Right alignment is 10 character width, which supports 2^32 (~2 billion) line numbers supported by 32-bit signed integer, without thousands separators.
  • Truncation for lines has been updated such that truncation now takes into account inclusion of the line number & separator to ensure whole line width stays within the pre-existing 1000 character limit.
  • Line numbers are 1 indexed based on the index in the list item virtual cache (index + 1).
    • NOTE: This assumes that this absolute index is correct in terms of position in source file and display in the tails window.

Testing:

  • Tested with a continuous append log file up to ~3 million lines.
  • Tested scrolling to begin/end of tails with
  • Tested scrolling to random sampling of positions within log file
  • Tested deleting a set of middle lines from log
    • NOTE: Update seemed to work correctly, however the update was slower than simple append updates and fast navigation to distant locations in the log as the entire file was reloaded & lines recalculated (existing functionality).

@Justaphf
Copy link
Author

Partial fix of request #26 for line numbers. Does not fix word wrap.

1. UI implementation for specifying the option per-session
2. UI implementation for specifying this option should apply to all open sessions
3. Persistence for saving this option per-session and as the global default
Optionally draws left padded line numbers based on user configuration to display line numbers
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.

None yet

1 participant