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 only for visible text as option for html #26

Closed ralf3u closed 1 year ago

ralf3u commented 2 years ago

If the issue #19 can be solved, then this issue could be interesting: A blinking vertical line in the Preview to show the position of the cursor of the editor, for all the code or only for visible text. Example: If in the editor the cursor is just before the body-tag, then the blinking vertical line should not appear in the preview, if in preview.conf the setting is blinking_vertical_line_for_visible_text_html=true. With the setting blinking_vertical_line_for_visible_text_html=true the blinking vertical line should also not appear for text with the css visibility: hidden or display: none.

The default settings in preview.conf could be something like this: blinking_vertical_line=false blinking_vertical_line_for_visible_text_html=true

xiota commented 2 years ago

Can you explain briefly how this is different from #19?

ralf3u commented 2 years ago

Can you explain briefly how this is different from #19?

In issue number 19 the blinking vertical line is either not in the preview or always in the preview. In issue number 26 there is a further differentiation for html-documents: The blinking vertical line is, when set to true, only visible if in the editor the symbol before the cursor is visible in the preview. So for example, if in the editor the cursor is just before the body-tag, then the blinking vertical line should not appear in the preview.

xiota commented 2 years ago

That seems more or less like a duplicate to me. Either way, I don't know how to transfer the needed info between editor and webview.

ralf3u commented 2 years ago

That seems more or less like a duplicate to me.

I think this explication is better:

Number of transfers from the editor to the preview:

ralf3u commented 2 years ago

I recognized today that for this issue not two signals need to be transferred from the editor to the preview, but three signals:

Then Preview could do something like that: IF ((symbol before cursor in the editor = symbol before cursor in the sidebar) OR (symbol after cursor in the editor = symbol after cursor in the sidebar)) THEN DO show blinking vertical line.

So, here an example with the code <p>The Matrix</p>: