Skip to content

Commit

Permalink
Added fix for escape. Need to have it removed when fullvim is disabled.
Browse files Browse the repository at this point in the history
  • Loading branch information
ardagnir committed Apr 20, 2014
1 parent 01dca35 commit 39e22f3
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions pterosaur.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"use strict";
var INFO =
["plugin", { name: "fullvim",
version: "0.3",
version: "0.4",
href: "http://github.com/ardagnir/pterosaur",
summary: "All text is vim",
xmlns: "dactyl" },
Expand Down Expand Up @@ -247,7 +247,7 @@ modes.INSERT.params.onKeyPress = function(eventList) {
}
*/

if (/^<(?:.-)*(?:BS|Esc|lt|Up|Down|Left|Right|Space|Return|Del|Tab|C-h|C-w|C-u|C-k|C-r)>$/.test(inputChar)) {
if (/^<(?:.-)*(?:BS|lt|Up|Down|Left|Right|Space|Return|Del|Tab|C-h|C-w|C-u|C-k|C-r)>$/.test(inputChar)) {
//Currently, this also refreshes. I need to disable that.
if (inputChar==="<Space>")
io.system("printf ' ' > /tmp/pterosaur_fifo");
Expand Down Expand Up @@ -327,6 +327,25 @@ modes.addMode("VIM_NORMAL", {
bases: [modes.INSERT]
})

//TODO: Fix these when fullvim is not set
mappings.builtin.add(
[modes.INSERT],
["<ESC>"],
["Override websites' carriage return behavior"],
function(){
io.system("printf '\\e' > /tmp/pterosaur_fifo");
},
{});

mappings.builtin.add(
[modes.VIM_NORMAL],
["<ESC>"],
["Override websites' carriage return behavior"],
function(){
modes.reset()
},
{});

mappings.builtin.add(
[modes.INSERT, modes.VIM_NORMAL],
["<C-r>"],
Expand Down

0 comments on commit 39e22f3

Please sign in to comment.