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

Highlight current line while writing and scroll to center #44

Open
jaap-karssenberg opened this issue May 18, 2017 · 8 comments
Open

Highlight current line while writing and scroll to center #44

jaap-karssenberg opened this issue May 18, 2017 · 8 comments
Milestone

Comments

@jaap-karssenberg
Copy link
Member

Use case is for more comfortable writing

  • highlight current line
  • option to keep current line in center of screen
@jaap-karssenberg jaap-karssenberg added this to the Release 0.68 milestone May 18, 2017
@jaap-karssenberg jaap-karssenberg self-assigned this May 18, 2017
@jaap-karssenberg
Copy link
Member Author

Search for "typewriter scrolling" to find examples of the behavior intended
Would work well together with distraction free mode.

@jaap-karssenberg
Copy link
Member Author

To implement the scrolling need add empty lines at the end, else we can not scroll last line to the center. This can be hidden from the user by making sure that when you click or move cursor to these lines the cursor ends up on the last line with content.

Also would need to make sure that when writing the buffer back to file, these lines are cut off.

Implementation of the highlighting is just a custom tag that is moved with the cursor.

@Osndok
Copy link
Collaborator

Osndok commented Jun 1, 2017

Are the empty lines really needed? That sounds a bit hackish. I think the proper way to do this would be to have additional render objects inside the scrollview, but outside of the textview. I have thought about plugins that would want to populate this space anyway (e.g. to show backlinks at the bottom of the page as the export does).

@jaap-karssenberg
Copy link
Member Author

@Osndok if you have some example code for that I'll be happy to use it

@Osndok
Copy link
Collaborator

Osndok commented Jun 1, 2017

I couldn't find a good example, but I was able to make a "proof" that it can be done.

I'm pretty sure the accepted solution involves ScrolledWindow(ViewPort(VBox(...)))... but don't know enough about python/gtk to wire up the signals correctly:

@CharlesNepote
Copy link

CharlesNepote commented Mar 18, 2018

Both functionalities should be enable/disable by an option.
Personally, I will be so happy to use current line highlighting but not sure about keeping the current line in the center of the screen.

One of my use cases: I often make transcription from old documents (XVIe-XVIIe century) and I need to compare line by line my transcription and the original document. Highlighting current line will help me to do so.

@jaap-karssenberg jaap-karssenberg removed their assignment Jan 15, 2019
@vossenjp
Copy link

vossenjp commented Apr 6, 2019

+1 for highlighted current line, -1M for keeping it centered

@ed0mm
Copy link

ed0mm commented Mar 16, 2022

This looks asleep but I wanted to add my +1 for it! Scroll to center would be a great addition for me, especially in the distraction free mode

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

No branches or pull requests

5 participants