simonsteele / pn

Programmer's Notepad
373 stars 115 forks source link

Comment line does not work #145

Open rovf opened 7 years ago

rovf commented 7 years ago

Editing a Ruby file, I had expected that Edit/Comments/Line (bound to Control-.) would put a '#' in front of the line, but it doesn't. The command doesn't seem to have any effect. Same with Stream and Block comments. Whil a Stream comment does not exist in Ruby, Line and Block comments do.

Programmer's Notepad 2.4.2

ghost commented 7 years ago

You'd need to edit your ruby.scheme file in the "schemes" directory. Look for the the <language> section and add the following line of code preferably immediately after the <lexer> element:

<comments line="#" blockStart="=begin" blockLine="=" blockEnd="=end" />

The above directive tells PN to use # for single line comments and =begin and =end to mark the beginning and end for block comments. However, there is a little caveat: PN requires the blockLine attribute to not be empty else it ignores the block comment directives altogether hence the use of the =. You may change it to whatever character you prefer, maybe #. If you find this behavior undesirable you could just use # for block comments too as is even preferred by some in the Ruby community.