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

add option to show line numbers in editor #2499

Open
wants to merge 2 commits into
base: master
from

Conversation

@tessus
Copy link
Collaborator

tessus commented Feb 12, 2020

This also allows code folding in the editor.

The editor options showLineNumbers and showFoldWidgets are true by default.
But they only show up, if the gutter is displayed, which is explicitly disabled in Joplin.
Therefore this change only toggles the gutter.

see https://discourse.joplinapp.org/t/feature-request-folding-sections-of-text/5752?u=tessus

tessus added 2 commits Feb 12, 2020
This also allows code folding in the editor.

The editor options `showLineNumbers` and `showFoldWidgets` are true by default.
But they only show up, if the gutter is displayed, which is explicitly disabled in Joplin.
Therefore this change onlu toggles the gutter.

see https://discourse.joplinapp.org/t/feature-request-folding-sections-of-text/5752?u=tessus
@tessus

This comment has been minimized.

Copy link
Collaborator Author

tessus commented Feb 12, 2020

I can also create 2 options: one for line numbers and the other for folding marks. But I thought it's not unreasonable to combine them and use only one setting.

@laurent22

This comment has been minimized.

Copy link
Owner

laurent22 commented Feb 14, 2020

I feel this feature is incomplete if what's shown in the text editor is not reflected in the viewer pane, and doing so would be very hard to implement. So we would have to leave it as it is, which for me looks a bit broken.

@tessus

This comment has been minimized.

Copy link
Collaborator Author

tessus commented Feb 14, 2020

If you take the code folding alone, I agree. But I think that many people would just be able to show line numbers (in which case the folding marks are just a bonus).

Showing line numbers in an editor is a fundamental editor feature. I haven't done any research about the statistics. I couldn't live without ine numbers in Sublime Text. Not sure how important it is in Joplin. But hey, if people want it, why not? It's not really my place to tell them they don't need it in Joplin.

@tallguyjenks

This comment has been minimized.

Copy link

tallguyjenks commented Feb 15, 2020

i want this feature very badly, not just line numbers but also relative line numbers. like all my editors vscode/rstudio/vim etc. i use the vim keys mode and having the relative line numbers help with navigation through the text and in the desktop version this is more difficult than the CLI version. it would be great if desktop had at least line numbers to start if not relative line numbers as a toggle-able option

@tessus

This comment has been minimized.

Copy link
Collaborator Author

tessus commented Feb 15, 2020

Using relative line numbers is not possible. react-ace uses brace which in turn uses an ace version that is several years old (1.2.9). The dev of brace seems to have abandoned the project, so that's that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.