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

(duplicate) Sync position between View and Edit modes for ToC #1060

Closed
contrapunctus-1 opened this issue Sep 14, 2020 · 7 comments
Closed

(duplicate) Sync position between View and Edit modes for ToC #1060

contrapunctus-1 opened this issue Sep 14, 2020 · 7 comments

Comments

@contrapunctus-1
Copy link

Thanks for adding the ToC - it makes it easy to read large files. I have a request for a behaviour which would greatly ease their editing as well.

Situation

  1. View mode. User taps a ToC heading.
  2. They switch to edit mode.

Current behavior

The cursor is placed at the beginning of the document (even with the 'open at end' option enabled? Might be a bug.)

Suggested behaviour

Place the cursor at or below the heading.

If there is a concern about a case where the user -

  1. taps a ToC heading
  2. scrolls around, possibly going to another section
  3. switches to edit mode

...then the behavior could be to fall back to usual behavior (cursor at start or end of document) if the user scrolls after tapping the ToC heading.

This would make editing large files a lot easier.

@gsantner
Copy link
Owner

Hi, that ToC is only there for edit mode, hence it should be only available in edit mode.

Thus, resolve will be that the edit mode ToC gets disabled/unavailable on view mode.

@gsantner gsantner changed the title Using the ToC heading we tapped on md: Disable edit-mode ToC in view-mode Sep 15, 2020
@gsantner gsantner added this to the v2.4 milestone Sep 15, 2020
@contrapunctus-1
Copy link
Author

Hey, @gsantner . I'm not sure what you mean by "edit mode ToC" - I haven't seen any ToC in the edit mode. 🤔 I'm running v2.3.2 from F-Droid.

@gsantner
Copy link
Owner

Please share a screenshot what you actually tap, thats clears things.

@contrapunctus-1
Copy link
Author

contrapunctus-1 commented Sep 19, 2020

@gsantner Here is a video demonstrating the problem - https://upload.disroot.org/r/bPbuFGWV#ukUtez62aWnV3AvNGsVrBHgvRjpjBNGR8Ogomo21Og8=

(I'm not sure why the search didn't take me to the result I tapped on, nor why the usual Markdown syntax highlighting was missing...problems for another day.)

@gsantner gsantner changed the title md: Disable edit-mode ToC in view-mode md: Synchronized view-mode and edit-mode scroll state Sep 20, 2020
@gsantner gsantner removed this from the v2.4 milestone Sep 20, 2020
@gsantner
Copy link
Owner

OK, so your request is to synchronize view mode scroll state with edit mode scroll state.

This has been already requested, and I marked it as a won't fix (#679). It's due it's not feasible to implement, the view content (/HTML) does not fully correlate to the original text (otherwise it wouldn't have been converted :P).

@gsantner gsantner changed the title md: Synchronized view-mode and edit-mode scroll state (duplicate) Sync position between View and Edit modes Sep 20, 2020
@contrapunctus-1
Copy link
Author

contrapunctus-1 commented Sep 20, 2020

@gsantner I'm well aware of that issue. This is not a duplicate; note the title I had set - "Use the ToC heading we tapped on". The program just derives the information of where to open edit mode from the ToC heading the user tapped.

Surely the heading in edit mode is guaranteed to correlate to the ToC heading??

@gsantner
Copy link
Owner

gsantner commented Sep 20, 2020

Surely the heading in edit mode is guaranteed to correlate to the ToC heading??

Nope, you can have

## My ~~Cool~~ Headline
text

for example and it will be something different in view vs edit mode.

1

2

3

we would need a HTML to Markdown converter, which is out of scope of the project.

To me it's not much of a difference if it's about sync just the headings, or everything.

@gsantner gsantner changed the title (duplicate) Sync position between View and Edit modes (duplicate) Sync position between View and Edit modes for ToC Sep 20, 2020
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

2 participants