elementary / code

Code editor designed for elementary OS
https://elementary.io
GNU General Public License v3.0
480 stars 112 forks source link

improper markdown auto comment on empty lines #1466

Closed sudanchapagain closed 1 month ago

sudanchapagain commented 1 month ago

What Happened?

When you try to auto-comment with control + / on a empty line in markdown file it places a closing comment on the end of next line without comment opening tag.

Steps to Reproduce

  1. open a markdown file.
  2. enter a new empty line and some text content or nothing.
  3. auto comment on the top empty line.
  4. error reproduced.

Expected Behavior

It should create a opening and closing tag on the same line with no text content inside.

OS Version

7.x (Horus)

Session Type

Classic Session (X11, This is the default)

Software Version

Latest release (I have run all updates)

Log Output

No response

Hardware Info

No response

sudanchapagain commented 1 month ago

on video:

https://github.com/user-attachments/assets/9ce709d2-5967-4c1e-a28f-0a3e99008d66

jeremypw commented 1 month ago

This also affect other languages with block type comments such as XML. Repeated pressing of hotkey results in addition closing comment tags rather than toggling. The issue is in the CommentToggler rather than the markdown plugin.