AdaCore / gnatstudio

GNAT Studio is a powerful and lightweight IDE for Ada and SPARK.
399 stars 52 forks source link

Idea: split comments and literal strings on Return keypress #162

Closed zertovitch closed 1 year ago

zertovitch commented 1 year ago

A very cool feature would be that when the cursor is within a comment and the user presses Return, the comment is split into two comments. Concretely, the editor would add "-- " right after the possible indentation. Same for string literals. You can see this feature in action in the LEA editor. For the code in LEA, see https://github.com/zertovitch/lea/blob/master/lea_gwin-editor.adb and spot in_ada_comment and in_ada_string_literal.

ogorodnik commented 1 year ago

Hello,

Could you have a look on the following blog post:

https://blog.adacore.com/new-features-for-string-literals-and-comments-in-gnat-studio

As far as I understand that is what you need.

zertovitch commented 1 year ago

Yes - lovely! Side note: obviously I didn't notice the feature because it requires Shift+ something to happen... On Matlab comments are split by default on Return keypress. It gave me the idea of copycatting that behaviour on LEA...