Skip to content

Add option to display line numbers - #113

Open
Justaphf wants to merge 2 commits into
snakefoot:masterfrom
Justaphf:feature/LineNumbers
Open

Add option to display line numbers#113
Justaphf wants to merge 2 commits into
snakefoot:masterfrom
Justaphf:feature/LineNumbers

Conversation

@Justaphf

Copy link
Copy Markdown

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
Copy Markdown
Author

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

Justaphf added 2 commits July 12, 2018 00:57
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
@Justaphf
Justaphf force-pushed the feature/LineNumbers branch from 1e8599f to 3b60969 Compare July 12, 2018 05:07
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