Skip to content

add line numbers and error marking - #40

Draft
graphiteisaac wants to merge 4 commits into
gleam-lang:mainfrom
graphiteisaac:line-numbers
Draft

graphiteisaac wants to merge 4 commits into
gleam-lang:mainfrom
graphiteisaac:line-numbers

Conversation

@graphiteisaac

Copy link
Copy Markdown
Member

Simple one - adds line numbers and marks errors on the line they're at. The way I'm doing the error highlighting is a little funky but it's dead simple (CSS class applied to lines, based on regex matching the error message), which I think is fine for something like this.

image

@lpil lpil left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you undo the unrelated changes please 🙏

@graphiteisaac

Copy link
Copy Markdown
Member Author

Oops, my formatter ran but it didn't look visually different in my editor... lol, will fix

@lpil lpil left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked out this branch and ran it but I don't see line numbers or any marking for errors? Is there something else I need to do?

.codeflask .codeflask__lines {
background: var(--code-background);
color: var(--code-token-punctuation);
font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How come a different font is being used here?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's to override what Codeflask sets; I've copied it from the parent element, I believe.

@graphiteisaac

Copy link
Copy Markdown
Member Author

I checked out this branch and ran it but I don't see line numbers or any marking for errors? Is there something else I need to do?

Tremendously embarrassing; but when I rolled back to fix the formatting issues, I didn't re-add the config option... it will work now.

@lpil

lpil commented Oct 15, 2026

Copy link
Copy Markdown
Member
image

Maybe it's just me, but it looks like there's too much space to the left of the line numbers initially. It looks better with 10+ lines though. Not sure there's anything to be done really...

image

I found this weird bug though!

@lpil
lpil marked this pull request as draft October 15, 2026 20:12
@graphiteisaac

Copy link
Copy Markdown
Member Author

That bug is odd, I'll fix it. The left side spacing is awkward with few lines but I think it would be far more awkward to have it shift visually when you add more lines.

@lpil

lpil commented Nov 4, 2026

Copy link
Copy Markdown
Member

Is this ready for review @graphiteisaac ? :)

@graphiteisaac

Copy link
Copy Markdown
Member Author

Is this ready for review @graphiteisaac ? :)

Yes, sorry I didn't say so earlier!

This branch has not been deployed

No deployments
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