quintanar401 / language-kdb-q

syntax and autocomplete for KDB Q
MIT License
7 stars 4 forks source link

Toggling comments #1

Closed mortensorensen closed 7 years ago

mortensorensen commented 7 years ago

May not be an issue with the package, but what is the best approach to get toggle comment functionality? By default, pressing Cmd-/ gives

/*
some code
some more code*/

Would be great if the correct functionality could be added to the package without setting up new key bindings or installing other packages.

Thanks

quintanar401 commented 7 years ago

What do you think the correct functionality should be? I guess this binding is from some other package.

mortensorensen commented 7 years ago

It would be to have each selected line prefixed by / when pressing Cmd-/. In Sublime this is achieved by adding a Comments.tmPreferences file (see https://github.com/komsit37/sublime-q/blob/master/syntax/Comments.tmPreferences). I am unsure how (and if) this is possible in Atom, hence the question. But I doubt people comment out blocks of code manually, so would like to get some pointers on this.

quintanar401 commented 7 years ago

I've added this to settings but I used // for comments because / may accidentally comment a blank line and this looks like EOF comment. If you prefer / add to your settings file this:

'.source.q':
  'editor':
    'commentStart': '/ '
mortensorensen commented 7 years ago

Works perfect. Thank you!