Skip to content

Conversation

@sgupta7857
Copy link

exports.CMD_ADD_TO_WORKINGSET_AND_OPEN = "cmd.addToWorkingSetAndOpen"; // DocumentCommandHandlers.js handleOpenDocumentInNewPane()

// NAVIGATE
exports.NAVIGATE_NEXT_DOC = "navigate.nextDoc"; // DocumentCommandHandlers.js handleGoNextDoc()
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't do it this way, since this is only going to fix part of it. This file is defining a module with the default set of Commands. Elsewhere in the code, you'll see that there are users of this:

$ git grep NAVIGATE_NEXT_DOC 
src/command/Commands.js:    exports.NAVIGATE_NEXT_DOC           = "navigate.nextDoc";           // DocumentCommandHandlers.js   handleGoNextDoc()
src/command/Commands.js:    exports.NAVIGATE_NEXT_DOC_LIST_ORDER    = "navigate.nextDocListOrder";           // DocumentCommandHandlers.js   handleGoNextDocListOrder()
src/command/DefaultMenus.js:        menu.addMenuItem(Commands.NAVIGATE_NEXT_DOC);
src/command/DefaultMenus.js:        menu.addMenuItem(Commands.NAVIGATE_NEXT_DOC_LIST_ORDER);
src/command/Menus.js:        NAVIGATE_DOCUMENTS_COMMANDS:        {sectionMarker: Commands.NAVIGATE_NEXT_DOC},
src/document/DocumentCommandHandlers.js:    CommandManager.register(Strings.CMD_NEXT_DOC,                    Commands.NAVIGATE_NEXT_DOC,              handleGoNextDoc);
src/document/DocumentCommandHandlers.js:    CommandManager.register(Strings.CMD_NEXT_DOC_LIST_ORDER,         Commands.NAVIGATE_NEXT_DOC_LIST_ORDER,   handleGoNextDocListOrder);
src/extensions/default/NavigationAndHistory/main.js:        KeyBindingManager.addBinding(Commands.NAVIGATE_NEXT_DOC, KeyboardPrefs[NEXT_IN_RECENT_FILES]);
test/perf/OpenFile-perf-files/brackets-concat.js:    exports.NAVIGATE_NEXT_DOC           = "navigate.nextDoc";
test/perf/OpenFile-perf-files/brackets-concat.js:        CommandManager.register(Strings.CMD_NEXT_DOC,           Commands.NAVIGATE_NEXT_DOC, handleGoNextDoc);
test/perf/OpenFile-perf-files/brackets-concat.js:        KeyBindingManager.addBinding(Commands.NAVIGATE_NEXT_DOC, [{key: "Ctrl-Tab",   platform: "win"},
test/perf/OpenFile-perf-files/brackets-concat.js:    exports.NAVIGATE_NEXT_DOC           = "navigate.nextDoc";
test/perf/OpenFile-perf-files/brackets-concat.js:        CommandManager.register(Strings.CMD_NEXT_DOC,           Commands.NAVIGATE_NEXT_DOC, handleGoNextDoc);
test/perf/OpenFile-perf-files/brackets-concat.js:        KeyBindingManager.addBinding(Commands.NAVIGATE_NEXT_DOC, [{key: "Ctrl-Tab",   platform: "win"},

So you'd have to deal with all the various call sites too. A better solution would be to just not add the keybinding.

Also, if you do this for NEXT, you should probably do it for PREV too.

@humphd
Copy link

humphd commented Mar 17, 2017

This fix still isn't right. What happens if you just remove these lines? https://github.com/mozilla/brackets/blob/master/src/base-config/keyboard.json#L263-L272 Can you test that and see if it solves his issue?

@sgupta7857
Copy link
Author

@humphd Sir, I made changes that fixes the key-binding error. I think the issue here was that on mac system shift+command was triggering windows + pageup/pagedown button.
The solution is either to remove the key binding that triggers next/prev page
or add special key binding for next/prev on osx platform.

Copy link

@humphd humphd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of problems to clean up here, let me know when those are fixed and I'll test and merge.

{
"key" : "Ctrl-Alt-H"
},
},
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to remove this extra space you added.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I made the changes in the latest commit.please review it

exports.TOGGLE_ACTIVE_LINE = "view.toggleActiveLine"; // EditorOptionHandlers.js _getToggler()
exports.TOGGLE_WORD_WRAP = "view.toggleWordWrap"; // EditorOptionHandlers.js _getToggler()
exports.TOGGLE_ALLOW_JAVASCRIPT = "cmd.toggleAllowJavaScript"; // EditorOptionsHandlers.js _getToggler()
exports.TOGGLE_AUTO_UPDATE = "cmd.toggleAutoUpdate"; // EditorOptionsHandlers.js _getToggler()
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to restore this file to how it should be. Use git checkout master src/command/Commands.js to fix.

@humphd humphd merged commit 030224d into mozilla:master Mar 20, 2017
@humphd
Copy link

humphd commented Mar 20, 2017

Merged, thanks a lot. @flukeout will be thrilled!

@humphd humphd changed the title [WIP] Issue #1846 Remove key binding Fix #1846 Remove key binding Mar 20, 2017
Rajat-dhyani pushed a commit to Rajat-dhyani/brackets that referenced this pull request Apr 20, 2017
* Remove key binding

* Commit changes

* indent fixes

* Changes - that add new for next/prev page [OSX]

* Remove key-binding next/prev

* Indent changes

* mend
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants