xiota / geany-preview

Turns Geany into a markdown editor by providing a preview pane in the sidebar to show the formatting of several light-weight languages as they are edited. Supported document types include AsciiDoc, DocBook, Fountain, HTML, LaTeX, Markdown, MediaWiki, reStructuredText, Textile, and Txt2Tags.
GNU General Public License v3.0
12 stars 0 forks source link

a blinking vertical line in the Preview to show the position of the cursor of the editor #19

Open ralf3u opened 2 years ago

ralf3u commented 2 years ago

Steps to reproduce

Result It takes time to know where the highlighted line of the editor is located in the Preview-tab.

Expectation

Options In preview.conf there should be the possibility

The default settings should be false. So, with the appropriate settings the user has then four options: 1) no eye-catcher 2) eye-catcher when the editor is in focus 3) eye-catcher when the sidebar is in focus 4) eye-catcher when the editor or the sidebar is in focus.

So, a user who is using either the second or the third option has then the possibility to disable the eye-catcher for example by using the shortcut toggle editor/sidebar.

Context The feature could be particularly interesting when there is a lot of text without empty lines and without paragraphs. Then the eye-catcher could be a useful help for orientation.

xiota commented 2 years ago

It sounds like you want something like a blinking caret in the preview pane. I don't know how to do that.

ralf3u commented 2 years ago

It sounds like you want something like a blinking caret in the preview pane. I don't know how to do that.

The feature blinking vertical line would be especially interesting for corrections of text.

During one issue I was sure that it is impossible to define a background color of an html-document that does not use a background color. But I was wrong. So, for me it seems to be that there is a free space between html-document and the rendering in the Preview-tab. In this free space it seems to be that one can add a document, like extra-media.css. So, if this is possible, then a blinking vertical line could be maybe solved the same way, by adding another css with css animation. Yesterday I found a blinking vertical line on google: css blinking cursor animation. The first result is amitmerchant.com/simple-blinking-cursor-animation-using-css/ where a blinking cursor is created only by css.

I don't how to program a software, but maybe the following thoughts could help to find a solution. So, here in slow motion the fire of the blinking vertical line:

If only css can be added that will be respected in the preview, so no other document format, then the blinking vertical line is a good idea, that can not be realized.

xiota commented 2 years ago

The info about making blinking cursors with css is helpful. Being able to send caret location from the editor to the webview is part of the problem.

ralf3u commented 2 years ago

Being able to send caret location from the editor to the webview is part of the problem.

That's right. I forgot that point. So, that are at least three steps:

ralf3u commented 2 years ago

A blinking vertical line in a customizable color would be even better.

xiota commented 2 years ago

I think this depends on solving the editor/webview sync problem. Right now, I know how to get the cursor position in the editor, but don't know how to translate that to the webview.