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

BUGFIX: Tail log does not render multiline logs properly in edge cases #1838

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

catloversg
Copy link
Contributor

MRE:

/** @param {NS} ns */
export async function main(ns) {
  ns.tail();
  ns.clearLog();
  ns.print("a\n\u001b[39mb");
}

In pre-v2.7.0, "a" and "b" are printed on 2 lines. In v2.7.0, they are printed on the same line. This is a regression bug caused by the display: "inline-block" style added in #1703.

inline-block is supposed to ensure that line height is displayed properly. However, when I test many combinations of tail font size and line height, it seems that we don't need to use inline-block.

Test code 1:

/** @param {NS} ns */
export async function main(ns) {
  ns.tail();
  ns.clearLog();
  ns.print("| a");
  ns.print("| b");
}

Test code 2 (provided by @G4mingJon4s): https://gist.github.com/G4mingJon4s/ba804da307e356268ee1f01f20b4af19

Screenshots:
Tail font size 16, line height 1.5
16-1 5
Tail font size 20, line height 1.5
20-1 5
Tail font size 20, line height 2
20-2
Tail font size 25, line height 3
25-3

@G4mingJon4s
Copy link
Contributor

Good catch! Honestly, I was not sure what the inline-block did in the first place. It once fixed line heights for bigger font sizes, but that issue seems to be gone.

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.

2 participants