Enable codefold


(Takuya Matsuyama) #21

Hi Samantha,

Hm, it looks nice but I guess the command name should be codefold:fold-all / codefold:unfold-all.
Maybe export-print plugin would be helpful as an example.

I think the command is only triggered while you are on the editor, so it’d be better if selectors for keymaps are like:

  ".platform-darwin .CodeMirror": {
    "cmd-r": "codefold:fold-all",
    "cmd-t": "codefold:unfold-all"
  ".platform-linux .CodeMirror": {
    "ctrl-r": "codefold:fold-all",
    "ctrl-t": "codefold:unfold-all"
  ".platform-win32 .CodeMirror": {
    "ctrl-r": "codefold:fold-all",
    "ctrl-t": "codefold:unfold-all"

And I guess cmd-r and cmd-t are kind of too general key combination because it’s often used for reloading, running, compiling, tabs, etc.
So other key combination would be nice like cmd-shift-o / cmd-shift-u.

Hope that helps!

(Samantha Zhang) #22

Made an update: https://github.com/moyicat/inkdrop-code-fold/commit/e7f1d9cbe356a1eafebf7a3c9c31c71581abc805

But I’m still not seeing keymap here:

(Takuya Matsuyama) #23


Thanks for the information.
I tried your plugin and found that keybindings are correctly loaded:

But there are two problems.

First, you should name commands starting with code-fold: which is your exact plugin name. Because the app tries to find commands that start with "<your plugin name>:" on your plugin detail screen. So please rename from codefold:fold-all to code-fold:fold-all.

Second, I found a bug that keybindings on the plugin screen doesn’t show them correctly if a selector has a platform. I’ll fix it in the next release!

Thanks again.

(Samantha Zhang) #24

Gotcha! Updated and published a new version :slight_smile:

(Takuya Matsuyama) #25

Great! And v3.20.2 has resolved the second issue. Thanks again!

(Yuko Otawara) #26

It’s cool plugin! Thanks!