Comment command


#1

Dear all,

good day to you!

I would ask, how can I comment line code in Ubuntu? ctrl-shift-O
I use german keyboard…

warm regards,
Leslie


#2

Hi,

The command editor:toggle-line-comments is bound to ctrl-/ by default.

If you want it bound to ctrl-shift-O you can add the following to your keymap file:

'atom-text-editor:not([mini])':
  'ctrl-shift-O': 'editor:toggle-line-comments'

#3

Hi,

It doesn’t works for fortran fixed form code as (c/c++ comment):
/daf = phi
ddf = 2.0d0
/

correct is:
! daf = phi
! ddf = 2.0d0

Kind regards,
leslie


#4

Hello.

Which package are you using to get the syntax highlighting for Fortran?
I assume: https://atom.io/packages/language-fortran

To me it looks like there is a problem with the definition for source.fortran.fixed. Looks to me if the comment style is not defined for the “fixed” variant.

See:

I assume this can be resolved if adding the lines…

'.source.fortran':
  'editor':
+   'commentStart': '! '
+   'commentEnd': ''

Regards.


#5

Thanks! I think It should be a bug in this plugin (c++ comment …)


#6

I ran into this long ago: https://github.com/dparkins/language-fortran/issues/78. I haven’t used that package in a long time though.


#7

Hello Leslie.

If you change the two lines in the language / grammar package as shown above, then you will be good to go. The C++ style commentary is the default for language / grammars.

Cheers.


#8

Hi DanPadric,

many thanks!

I also find perhaps some bugs in this package:

If I use Fortran Modern or Fortran FreeForm, The grammatic colors are fully incorrect. namely: comment parts and grammatic parts have the same color!

Regards,
Leslie