Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags
(4 edits)

CodeMirror is used? I guess that's good to learn. :)

I've just made some experiments with it, and it turns out it already has such a functionality! There are two commands for searching : "find", and "findPersistent". The second one isn't bound to any keys by default, but it is used in the search interface demo. It quite does the job: searching is immediate, and requires only to press one key.

All there is to do to integrate it is to add the command in extraKeys in the options on CodeMirror instantiation:

var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
  mode: "text/html",
  lineNumbers: true,
  extraKeys: {"Alt-F": "findPersistent"}
});

I also tested it with the Sublime keyMap, and it works as well. The keys can overwrite an existing command by the way.

Maybe the best choice should be to keep the Find command as it is now, and bind this one to another key combination. Maybe "Shift-Ctrl-F", or "Alt-F" as in the demo (though it's not the most intuitive, but eh, that's mostly my opinion). That's up to you to decide.

Now that I'm thinking of it: are there any plans for a keys/shortcuts personal configurations?


Update: After exploring Superpower's source code, it seems to me this should be done in the textEditorWidget plugin. Should I create a pull request?

(1 edit)

A pull request would be much appreciated, so we can test it out, discuss & merge if it fits!

We (as in, the core dev team) don't have immediate plans for a full-blown keyboard shortcut customization UI but maybe someday, if someone comes up with a good design :)

Cheers!

(EDIT: That was Elisée, posting with the wrong account whoops)