dvcrn / proton

space-atom. spacemacs and sublimious style editing in atom
GNU General Public License v3.0
565 stars 55 forks source link

Defining non-builtin keybindings has no effect #259

Closed jotadrilo closed 7 years ago

jotadrilo commented 7 years ago

It seems the :keybindings section works properly when I try to overwrite a built-in keybinding. However, when a combination not already defined by proton is used, it has no effect.

Example:

  :keybindings {
    :s {
      :category "search"
      :s {
        :title "narrow scan"
        :action "narrow:scan"
      }
      :p {
        :title "narrow search project"
        :action "narrow:search-current-project"
      }
    }
  }

In this case, SPCss has been properly overridden by narrow scan but SPCsp (which is not predefined by proton) does nothing.

This may be related to #256 but it is slightly different.

jackcasey commented 7 years ago

This might be related to the target of the action being missing. In .proton you cannot use :target actions/get-active-pane or any other functions. And leaving target blank means the action that is bound has no context of the 'current window' etc and many actions require this.

Try specifying :target ".editor.is-focused" (You can specify CSS selectors as targets in .proton).

jotadrilo commented 7 years ago

@jackcasey you are right, that worked like a charm!

I also reviewed the proton manual and I saw an example in the manual and it is said that the target can be specified.

I think the lack of knowledge about atom/proton is the main issue here so I guess this can be closed since it is not an actual issue.

Thanks a lot for the help! :)

dvcrn commented 7 years ago

I think the lack of knowledge about atom/proton is the main issue here

working on that 😅

jotadrilo commented 7 years ago

Actually, I meant my lack of knowledge. Unfortunately, you cannot work on that 😛