davidgranstrom / scnvim

Neovim frontend for SuperCollider.
GNU General Public License v3.0
197 stars 26 forks source link

feat: add desc option to scnvim.map, close #202 #203

Closed salkin-mada closed 1 year ago

salkin-mada commented 1 year ago

Not sure if this would create any issues/breaking-changes in regard to the callback and flash params/args of the apply_keymap func? It seems logical to have desc as the third param. Please advice. :)

salkin-mada commented 1 year ago

ah yes.. would have to update the docs

davidgranstrom commented 1 year ago

Hi @salkin-mada, sorry about the delay. I agree it would be nice to be able to set custom descriptions to keymaps. How about making the third argument into an options table? That way we can extended it easily in the future as well.

map('editor.send_line', 'n', {
  desc = 'A custom description',
  callback = function(lines) return lines end,
  flash = true,
})
davidgranstrom commented 1 year ago

Btw, the docs action will fail for the moment so that can be ignored for now. You can run the lint and style checks locally using the Makefile in the root of the repository.

Edit: There seems to be an issue with the style checks on the CI, I'll have to investigate further

davidgranstrom commented 1 year ago

The CI workflow has been fixed by #205

salkin-mada commented 1 year ago

Hi @salkin-mada, sorry about the delay. I agree it would be nice to be able to set custom descriptions to keymaps. How about making the third argument into an options table? That way we can extended it easily in the future as well.

map('editor.send_line', 'n', {
  desc = 'A custom description',
  callback = function(lines) return lines end,
  flash = true,
})

Sure thing! Either my desc.value way or your options table #210 . Would just be a great detail feature to have. :)

davidgranstrom commented 1 year ago

Closing this PR since #210 was merged, thanks again @salkin-mada for the request!