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

Marktext changes stuff even if nothing was done pressed by the user #2048

Closed
1 task done
B0pol opened this issue Apr 16, 2020 · 6 comments
Closed
1 task done

Marktext changes stuff even if nothing was done pressed by the user #2048

B0pol opened this issue Apr 16, 2020 · 6 comments

Comments

@B0pol
Copy link

B0pol commented Apr 16, 2020

Description

Marktext edits the file, even if I haven't changed anything

  • Can you reproduce the issue?

Steps to reproduce

Gif 1:

  1. Open any file
  2. See the edit marker on top. Or press alt+f4, it will ask for save confirmation

Gif 2:

  1. Open an empty file
  2. write something then delete it.
  3. See the edit marker on top. Or press alt+f4, it will ask for save confirmation

Expected behavior:
Gif 1 & Gif 2:
Marktext doesn't show a button at top to mean the file has changed.
Marktext doesn't ask for confirmation when quitting.
Marktext doesn't edit stuff when I press nothing. We expect it to automatically edit files with a key combination, not pressing anything.

Actual behavior:
add lines or delete lines, reorder characters…

Link to an example: [optional]

GIF number 1
GIF number 2

Versions

  • Mark Text: 0.16.1 RPM
  • Operating system: Fedora 31

PS: as you can see some things are deprecated, but it's not the subject of this ticket

@eagleofnorth
Copy link

Hi @B0pol,

The Gif 2 example seems perfectly logical to me. You open Mark Text and get an empty document (not saved yet). You type something (and delete it). Mark Text then assumes the document has changed and asks you to to save it. Any editor does it like that.

Gif 1 example:

The README.md file you are opening - is that a proper Markdown file or is it actually a HTML file?

Simply opening any proper .md file and putting the cursor on top does not make Mark Text suggest file save when I test it.

@B0pol
Copy link
Author

B0pol commented Apr 17, 2020

Any editor does it like that.

Not vscode, not atom. And if it you changed nothing at the end, when quitting, it makes no sense to save nothing. But indeed gedit, libreoffice do that.

The README.md file you are opening - is that a proper Markdown file or is it actually a HTML file?

It's this repos's README.md in the GIF. But it also happens with all the README.md I've tested mixing HTML and markdown. It doesn't happen with .md files with text only.

@eagleofnorth
Copy link

Hi again, @B0pol

Agreed, not all editor does it like that. I tested Sublime Text and LibreOffice only - which did.

Regarding Gif 2 I am able to reproduce the issue by creating a simple .md file with this test content (there are two empty lines below the table):

## Navigation in Joplin

| action                       | shortcut                                 |
| ---------------------------- | ---------------------------------------- |
| goto title                   | ctrl + shift + n                         |
| goto notebook sidebar        | ctrl + shift + s, arrow keys up and down |
| goto note list               | ctrl + shift + l, arrow keys up and down |
| goto note body               | ctrl + shift + b                         |
| goto options                 | ctrl + ‘,’                               |
| toogle section under heading | f2                                       |
| toggle sidebar               | f10                                      |
| toggle layout                | ctrl + l                                 |
| vertical scrolling           | shift + mousewheel                       |


When Mark Text opens this file it silently removes the last empty line and indicate that the document has changed. When saving it from Mark Text the file then has 14 lines, and there where 15 lines in the original file.

@axelsimon
Copy link

Looks related to #1966.

@brainchild0
Copy link
Contributor

In the case of an empty buffer, I suggest that no save confirmation is provided, regardless of whether the buffer was always empty or had been modified. An empty buffer is a special case. Because no content exists to be saved, it is reasonable to assume that the user has no wish to write a file. Of course, writing an empty file ought to be possible. But even if the user forgets, no work is lost.

@fxha
Copy link
Contributor

fxha commented Jun 6, 2020

I'm closing this issue in favour of #2189. You may want to subscribe there for further updates.

@fxha fxha closed this as completed Jun 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants