Opened 8 years ago

Last modified 3 years ago

#4322 accepted enhancement

OMEdit: Improve commenting of folded lines - but how?

Reported by: janK Owned by: adeas31
Priority: normal Milestone:
Component: OMEdit Version:
Keywords: commenting folded lines Cc:

Description

Commenting out folded lines in a hurry will result in syntax errors, as only the first line is commented out. It would be convenient if all lines are commented automatically.
One possibility is to add a // at the beginning of every other line. Another possibility is to replace the just typed // into a /* and to add a */ at the end of the folded part.

Removing the comments should follow the same automatic behavior.

What do you think? Or is it only me, who noticed that? - This is a discussion ticket!

Change History (12)

comment:1 Changed 8 years ago by adeas31

  • Milestone changed from Future to 1.12.0
  • Status changed from new to accepted

I think there is no easy solution to it.
I suggest that we should unfold the block and let user decide what to comment/uncomment.

I tried some other editors like Qt Creator, Notepad++ and Visual Studio. Qt Creator and Notepad++ does exactly the way we are doing right now. However, Visual Studio unfolds the following section if the line which starts the fold is commented out.

comment:2 Changed 8 years ago by adeas31

I just added support for automatically unfolding the commented out block d79a354/OMEdit.

Note that if folding is in between comment then it doesn't matter.

comment:3 Changed 8 years ago by janK

Automatically unfolding the line is a simple and elegant solution. This will do the job as it will make the wrong syntax more obvious to the user now. You can close the ticket if you like.

comment:4 Changed 8 years ago by janK

I've just checked the new behavior in the latest nightly build. In my case, it will NOT automatically open the folding when I type //. I use the standard two-line style which is given by OMEdit (e.g. if you place a resitstor in the Diagram View). In this OMEdit style, the line ends with annotation( and the next line is indented with two spaces.

BTW: I really prefer exactly this two-line annotation style to the style which is used in the MSL and which is very inconsistent...

comment:5 Changed 7 years ago by adeas31

  • Milestone changed from 1.12.0 to 1.13.0

comment:6 Changed 6 years ago by casella

  • Milestone changed from 1.13.0 to 1.14.0

Rescheduled to 1.14.0 after 1.13.0 releasee

comment:7 Changed 5 years ago by casella

  • Milestone changed from 1.14.0 to 1.16.0

Releasing 1.14.0 which is stable and has many improvements w.r.t. 1.13.2. This issue is rescheduled to 1.16.0

comment:8 Changed 4 years ago by casella

  • Milestone changed from 1.16.0 to 1.17.0

Retargeted to 1.17.0 after 1.16.0 release

comment:9 Changed 4 years ago by casella

  • Milestone changed from 1.17.0 to 1.18.0

Retargeted to 1.18.0 because of 1.17.0 timed release.

comment:10 Changed 4 years ago by janK

@adeas31: You thought you fixed this ticket with 'd79a354/OMEdit'.
The idea to simply unfold the lines is great!

But as I pointed out (4 years ago), OMEdit will not do that when typing: //
(tested with the latest version).

Can you please check, what is going on? Thanks!

comment:11 Changed 4 years ago by janK

  • Type changed from discussion to enhancement

comment:12 Changed 3 years ago by casella

  • Milestone 1.18.0 deleted

Ticket retargeted after milestone closed

Note: See TracTickets for help on using tickets.