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

Show line numbers in cells #67

Closed
karlwessel opened this issue Apr 8, 2020 · 9 comments
Closed

Show line numbers in cells #67

karlwessel opened this issue Apr 8, 2020 · 9 comments
Labels
enhancement New feature or request frontend Concerning the HTML editor good first issue Good for newcomers

Comments

@karlwessel
Copy link
Contributor

Although most cells are only 1 line long there are some longer cells, for example for function definitions where knowing the line number without counting it would be nice to trace stacktraces.

There is already a little dot printed before each line, that one could be replaced with the line number for cells longer than a few lines.

@fonsp fonsp added enhancement New feature or request frontend Concerning the HTML editor labels Apr 8, 2020
@fonsp
Copy link
Owner

fonsp commented Apr 8, 2020

Replacing line numbers with small \cdots was intentional, to make the editor look more friendly 🎈

But you're right that having to manually count lines is a bit silly, I'll look into showing the line numbers on hover.

Eventually, the ideal solution is to highlight lines directly in the editor from the stacktrace, like most modern IDEs.

@fonsp fonsp added the good first issue Good for newcomers label Apr 8, 2020
@fonsp
Copy link
Owner

fonsp commented Apr 8, 2020

(To anyone picking up this issue: this behaviour is defined here, and can be changed on the fly by setting the lineFormatter option of a codemirror to i => "" + i and calling .refresh() on that codemirror. But it would be nicer to do this just using CSS, perhaps using the ::after selector or by creating the dot using a background.)

@karlwessel
Copy link
Contributor Author

Replacing line numbers with small \cdots was intentional, to make the editor look more friendly

In that you succeeded, I really like the style how the notebooks look :).

Showing the line number only on mouseover will be completely sufficient.

@fonsp
Copy link
Owner

fonsp commented Apr 8, 2020

Alright! Great to hear that you have used Pluto enough to find this issue - keep the suggestions coming!

@fonsp fonsp closed this as completed in 03d8cc0 Apr 9, 2020
@fonsp
Copy link
Owner

fonsp commented Apr 9, 2020

Line numbers on hover in 0.5.20 👆

@karlwessel
Copy link
Contributor Author

I like it!

@SimonEnsemble
Copy link

many times during pair programming in Pluto.jl, can't communicate which line of a long function (in a single cell) to inspect. 😢 would be helpful for communication to have a setting/button where all line numbers are displayed. 😃

@niltsz
Copy link

niltsz commented Feb 27, 2023

I want to pick up on this issue and extend what @SimonEnsemble said. First, I love Pluto, especially the reactivity and the way it looks.
But I really think that having no line numbers should be changed. I use Pluto for teaching and every time I want to talk about the code or students want to ask something, there is this awkward necessity of describing which code snippets we are talking about ("up up up up up up up, down, stop, down, two down, one more, yeah, this line"). The same occurs when I want to show code to colleagues, also in an online meeting where no one can point with the finger at the monitor. Displaying the line numbers on hover does not really help with this issue as only one person can hold the mouse at a time, and the cursor can block the line number.
Pluto is such a good tool for learning how to program, and having line numbers would make it even better.
In Jupyter Notebooks, one can toggle line numbers and the cells are enumerated, so one can easily refer to something with "cell 17, line 8".
Having a "communication mode" as suggested above would be greatly appreciated (or having line numbers always on as I do not consider them to be intimidating or ugly, but rather extremely useful)

@trg818
Copy link

trg818 commented May 10, 2024

Are there news on this one? I have googled for the topic and didn't really find something that told me how to do it. I'm flabbergasted that such a fundamental feature has not been implemented in the first place and is the default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request frontend Concerning the HTML editor good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

5 participants