Giter Site home page Giter Site logo

Comments (8)

redmunds avatar redmunds commented on July 17, 2024

@PhiLhoSoft Copy to Current Document is meant for generating markup (e.g. to paste into a wiki page), so I don't want to remove that.

I agree that this should work better with the override shortcut functionality recently added to Brackets. I was thinking about providing a right-click menu on shortcuts and provide with an "Override" Command. Override Command would open keymap.json file and insert an entry for selected shortcut. User would have to manually edit existing shortcut to new shortcut and then Save file. How does that sound?

At the very least, panel should allow selection so you can copy a command id (which I tried to do recently :) ).

Care to submit a pull request?

from brackets-display-shortcuts.

PhiLhoSoft avatar PhiLhoSoft commented on July 17, 2024

Yes, I refrained from suggesting to remove the current button... :-) It can be useful... in some rare cases! :-D

For the pull request, I am currently learning how extensions work in Brackets, so it might take a while. ;-)

from brackets-display-shortcuts.

redmunds avatar redmunds commented on July 17, 2024

@PhiLhoSoft I added Override Shortcut and Disable Shortcut commands in this pull request. Does this satisfy you need?

from brackets-display-shortcuts.

PhiLhoSoft avatar PhiLhoSoft commented on July 17, 2024

Nice. I suggest to detect if a command is already disabled, so the menu acts as a toggle: I was able to deactivate twice the same command, resulting in a duplicated line in the keymap.json file.
The issue might be tracking the current assignment, to be able to restore it...

The Override shortcut command is a bit ambiguous, as it results instead in an override of the command, where we define a new shortcut for it. Or perhaps there should be both capabilities?

Side note: you add tabs in this file that seems to use spaces for indenting.

from brackets-display-shortcuts.

redmunds avatar redmunds commented on July 17, 2024

@PhiLhoSoft Thanks for reviewing these changes! Comments below.

I suggest to detect if a command is already disabled, so the menu acts as a toggle: I was able to deactivate twice the same command, resulting in a duplicated line in the keymap.json file.
The issue might be tracking the current assignment, to be able to restore it...

This functionality simplify facilitates editing the keymap.json file. It makes copying the command ids and keybindings easier. It would be a fair amount of work to get even a little smarter, so I probably won't be trying to do that.

The KeyBindingManager validates the file when you hit Save, but I guess that case is not critical enough to detect -- it shouldn't cause any problems in your configuration.

One update that I will consider (i.e. need to research) is to update the update the Shortcuts panel when keymap.json file is Saved to disk and keybindings are updated. This will fix the problem with being able to disable a shortcut twice because it will no longer be in the list.

The Override shortcut command is a bit ambiguous, as it results instead in an override of the command, where we define a new shortcut for it. Or perhaps there should be both capabilities?

You can't really override a command from here, but I think the command name could be more clear. What do you think about "Override Shortcut for Command" ?

Side note: you add tabs in this file that seems to use spaces for indenting.

The code should use your indent settings when editing that file. That's what you'll get when editing that file manually (using Debug > Open User Key Map), so that seems like the right thing to do. Let me know if it's not using your settings.

from brackets-display-shortcuts.

redmunds avatar redmunds commented on July 17, 2024

The Override shortcut command is a bit ambiguous, as it results instead in an override of the command, where we define a new shortcut for it. Or perhaps there should be both capabilities?

You can't really override a command from here, but I think the command name could be more clear. What do you think about "Override Shortcut for Command" ?

Actually, it's valid to have multiple shortcuts for a single command, so maybe message should say "Add Shortcut for Command" ?

from brackets-display-shortcuts.

PhiLhoSoft avatar PhiLhoSoft commented on July 17, 2024

This functionality simplify facilitates editing the keymap.json file.

OK, fair enough. And of course the toggle can be made just by removing the override.

"Add Shortcut for Command" sounds good.

[Off Topic] I didn't realize all these caps in menu items. I wonder what UI guideline they follow. Windows guideline recommend using simpler "Add shortcut for command", less sententious... Capitalized first letters are reserved for titles (of windows, of sections, etc.).

from brackets-display-shortcuts.

redmunds avatar redmunds commented on July 17, 2024

Good question about the capitalization. I looked at the context menus in Brackets and the words that are key to the command seem to be capitalized, so this seems consistent and I'll just leave it like this for now. Thanks for your feedback!

Merged with #46. Closing this issue.

from brackets-display-shortcuts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.