MCPcopy Create free account
hub / github.com/nwutils/nw-sample-apps / toLetter

Function toLetter

mini-code-edit/cm/keymap/vim.js:75–84  ·  view source on GitHub ↗
(ch)

Source from the content-addressed store, hash-verified

73 for (var i in l) f(l[i]);
74 }
75 function toLetter(ch) {
76 // T -> t, Shift-T -> T, '*' -> *, "Space" -> " "
77 if (ch.slice(0, 6) == "Shift-") {
78 return ch.slice(0, 1);
79 } else {
80 if (ch == "Space") return " ";
81 if (ch.length == 3 && ch[0] == "'" && ch[2] == "'") return ch[1];
82 return ch.toLowerCase();
83 }
84 }
85 var SPECIAL_SYMBOLS = "~`!@#$%^&*()_-+=[{}]\\|/?.,<>:;\"\'1234567890";
86 function toCombo(ch) {
87 // t -> T, T -> Shift-T, * -> '*', " " -> "Space"

Callers 2

charIdxInLineFunction · 0.85
setupPrefixBindingForKeyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected