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

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

Open
ralf3u opened this issue Nov 20, 2021 · 6 comments
Labels
enhancement New feature or request

Comments

@ralf3u
Copy link

ralf3u commented Nov 20, 2021

Steps to reproduce

  • Open a fountain-document like Big Fish.
  • Click right away in the middle of the editor within the text.

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

Expectation

  • A blinking vertical line in the Preview as eye-catcher.
  • The blinking vertical line should be in the text of the Preview at the same position like the cursor in the text of the editor.
  • The blinking vertical line should be from its visual effect like the cursor in the highlighted line of the editor.
  • The blinking vertical line should have the same font-size like the symbol before the eye-catcher.

Options
In preview.conf there should be the possibility

  • to enable the eye-catcher when the editor is in focus (with true)
  • to enable the eye-catcher when the sidebar is in focus (with true)
  • to enable the feature for each format (with true)

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
Copy link
Owner

xiota commented Nov 24, 2021

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

@ralf3u
Copy link
Author

ralf3u commented Nov 25, 2021

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:

  • detect the place of the cursor in the editor
  • connect the detection with the css for the blinking vertical line, maybe with JavaScript

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
Copy link
Owner

xiota commented Nov 25, 2021

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
Copy link
Author

ralf3u commented Nov 25, 2021

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:

  • detect the position of the cursor in the editor
  • transfer the position to the webview
  • connect the position with the css for the blinking vertical line

@ralf3u
Copy link
Author

ralf3u commented Nov 30, 2021

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

@xiota
Copy link
Owner

xiota commented Dec 1, 2021

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.

@xiota xiota added the enhancement New feature or request label Feb 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants