yori icon indicating copy to clipboard operation
yori copied to clipboard

Yedit: Reproducible crash related to auto indent

Open stianhoiland opened this issue 1 year ago • 3 comments

Yedit just crashed and I lost work (new, unsaved buffer). Is there a log somewhere? I think it happened while backspacing, possibly backspacing tabs.

stianhoiland avatar Dec 18 '24 15:12 stianhoiland

I got it to crash again and can now reproduce:

  1. Open yedit
  2. Press Tab
  3. Insert any character
  4. Press Enter twice
  5. Press Backspace
  6. Wait a tiny bit
  7. Crash

So it's likely related to auto indent.

stianhoiland avatar Dec 18 '24 15:12 stianhoiland

The about box says I'm using Edit 2.30.

stianhoiland avatar Dec 18 '24 15:12 stianhoiland

Thanks for the very thorough report, and sorry for taking a while to get back to it. The previous code was trying to remember the line that supplied the text to indent from, and use that when deleting an indent since it searched to earlier lines to find the amount of indent to keep. This logic conflicted with other code to truncate lines containing only auto indent and convert them to blank.

I think keeping the pointer to the line supplying the text is pointless, and it can navigate backwards from the current line. It makes sense to ignore blank lines when searching backwards anyway, and having done that, remembering the original source line is redundant. Commit c93f8e92211744c7ebc4657f5f078a50218364e8.

malxau avatar Dec 30 '24 05:12 malxau