question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Line and code aren't aligned

See original GitHub issue

I copied the code exactly as shown in the example, but adding lineNumbers option breaks the view:

image

From code inspection, I noticed that the lineNumbers option adds a <div> which comes before the <pre> block.

I played with the styling a bit and adding position: absolute; to the <div> and some padding to the <pre> solved it.

I can do it in my css file (unless it is scoped), thought it’d be better if you could check what is the problem with what I experience 😃

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Tzahilecommented, Apr 28, 2019

At first I only imported the import PrismEditor from "vue-prism-editor" locally in the component. Now I moved it to the main.js file with adding the css and it works. Thanks! and cool tool 😃

0reactions
kocacommented, Apr 28, 2019

You can use it in your components too. Just include the css and you’re good to go ^^

Read more comments on GitHub >

github_iconTop Results From Across the Web

Markdown line break position 【Not aligned】 #66808 - GitHub
VSCode Version: 1.30.2 OS Version: MacOS Steps to Reproduce: As you can see, the position of the newline in VSCode is the beginning...
Read more >
Lines of text not aligned with line numbers
But starting on page 4 the lines of text seem to drop down so they no longer align with the numbers. I can...
Read more >
(Formatting) New line-alignment within parentheses not ...
When having the option Text Editor/C++/Formatting/Indentation/“Within parentheses, align new lines when I type them” set to “Align contents to opening ...
Read more >
Text lines are not aligned when using lstlisting - TeX
When listings breaks a line that is too long, it inserts some space at the beginning of the new line(s). You can remove...
Read more >
Why Aligning Statements Will Haunt You | by Fagner Brack
Aligning code can look like an irrelevant code style opinion for an unsuspecting observer. However, it can hide important information and therefore need...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found