banacorn / agda-mode

agda-mode on Atom
https://atom.io/packages/agda-mode
MIT License
58 stars 14 forks source link

Key binding changes should be for agda files only #78

Open freeman42x opened 5 years ago

freeman42x commented 5 years ago

The keybindings specific to agda-mode are also affecting haskell files for example which makes it impossible to copy using Ctrl+C.

The agda-mode key bindings should only be enabled for .agda and .lagda files.

banacorn commented 5 years ago

https://github.com/banacorn/agda-mode/blob/102a7a6d992529aa02d3167305b6affef25a4c55/keymaps/agda-mode.cson#L11-L12

Ctrl+c Ctrl+l should be the only keybinding that is affecting Haskell files, as it is the sole command for activating agda-mode.

It's impossible to restrict the scope of Ctrl+c Ctrl+l to .agda or .lagda files.

There is a workaround, but it will require the users to have the language-agda package installed beforehand, so that the .agda files could be marked [data-grammar~="agda"]:

https://github.com/banacorn/agda-mode/blob/102a7a6d992529aa02d3167305b6affef25a4c55/keymaps/agda-mode.cson#L84-L85

And that's actually what it used to be, until recently, because it would stop the users from activating agda-mode if they forgot to install the language-agda package first, which would confuse the hell outta them.

freeman42x commented 5 years ago

I know for sure that multiple key bindings for Haskell files are affected by agda-mode and not just Ctrl+c, Ctrl+l.

When agda-mode is enabled Ctrl+C no longer works, and there are other keyboard changes.

What I currently do to get past this issue is to disable agda-mode plugin before working on Haskell files.

banacorn commented 5 years ago

Can I take a look at what the key binding resolver shows when you press Ctrl+C on Haskell files? (To open the key binding resolver, press Ctrl+. or Cmd+. on OS X)

freeman42x commented 5 years ago

With agda-mode disabled:

With agda-mode enabled:

banacorn commented 5 years ago

The temporary workaround: go to Settings > Keybindings and the text on the top should guide you to the place where you can modify and override the keybindings to your preferences.

The long term solution is that I should find a way to make sure that Atom package dependency can be handled automatically so that people won't have to install language-agda manually so that I can restrict the scope of keybinding of agda-mode.

freeman42x commented 5 years ago

Thank you. The workaround seems to have worked. I hope that was the only keybinding affected.