typora-issues icon indicating copy to clipboard operation
typora-issues copied to clipboard

Tab crashes if spellcheck hotkey reaches end of file

Open hierophect opened this issue 1 year ago • 3 comments

Describe the bug If you use the Mac spellcheck hotkey Command-: (⌘:), and step all the way to the end of the file, it will "crash" the tab instead of halting or wrapping around to the beginning. The tab will go completely blank, not showing any file text, and will not respond to any input - you cannot save the file, if it had edits, and closing the tab will result in a loss of data. I have found no way to "recover" the tab so far other than closing it and re-opening.

Notes:

  • This occurs across all themes, including builtin and custom ones
  • This occurs across all file types
  • Using the save hotkey while on the "crashed" tab will cause the computer to briefly stall, showing the "rainbow of death" spinning cursor for mac. Closing the tab will also be delayed by a second or so. Thankfully, the original file does not appear to be corrupted by this.
  • This occurs 100% of the time when following reproduction steps (on my machine), ie it's a completely predictable bug.

To Reproduce

  • Create a markdown file with at least one spelling error
  • Use the ⌘: hotkey to step through the spelling errors
  • After reaching the final spelling error in the file, using the ⌘: hotkey again should crash the tab.

Expected behavior When using other editors on Mac, such as TextEdit, the default behavior is to wrap around to the first spelling error in the file.

Desktop (please complete the following information):

  • OS: Mac OS Montery, 12.3.1

Typora Version Version 1.3.7

hierophect avatar Jul 22 '22 16:07 hierophect

Could you provide a sample md file and screencast? In my test, it works fine...

abnerlee avatar Jul 23 '22 07:07 abnerlee

example.md

@abnerlee Sorry, it actually only happens for files where the first line is [TOC]. Almost all of my note files have a TOC so I assumed it was all files, my bad! Example attached.

Before pressing command-: Screen Shot 2022-07-26 at 11 16 18 AM

After pressing command-: Screen Shot 2022-07-26 at 11 16 26 AM

hierophect avatar Jul 26 '22 15:07 hierophect

I can also confirm that it doesn't happen every time the spellchecker hits a TOC, it has to be a TOC in the very first line of the file.

hierophect avatar Jul 27 '22 20:07 hierophect

fixed in 1.4.4

abnerlee avatar Sep 06 '22 03:09 abnerlee