aboutsummaryrefslogtreecommitdiffhomepage
path: root/input.cpp
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-06-02 15:43:18 -0700
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-06-02 15:43:18 -0700
commitf8e3e853aa1b4bd0de2b2fdec4fef26291ecdbeb (patch)
tree47f5f74af8842052d98610d38a9af7999c59a0c1 /input.cpp
parentb7ba2529658e128bfd4b5aacb7702a13c6a9d820 (diff)
Fix to disable VDSUSP, which allows control-Y to serve as yank on OS X
Diffstat (limited to 'input.cpp')
-rw-r--r--input.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/input.cpp b/input.cpp
index 7e910d00..a01a8f13 100644
--- a/input.cpp
+++ b/input.cpp
@@ -434,8 +434,8 @@ static wint_t input_exec_binding( const input_mapping_t &m, const wcstring &seq
*/
static wint_t input_try_mapping( const input_mapping_t &m)
{
- int j, k;
wint_t c=0;
+ int j;
/*
Check if the actual function code of this mapping is on the stack
@@ -448,15 +448,22 @@ static wint_t input_try_mapping( const input_mapping_t &m)
input_unreadch( c );
const wchar_t *str = m.seq.c_str();
- for( j=0; str[j] != L'\0' && str[j] == (c=input_common_readch( j>0 )); j++ )
- ;
+ for (j=0; str[j] != L'\0'; j++)
+ {
+ bool timed = (j > 0);
+ c = input_common_readch(timed);
+ if (str[j] != c)
+ break;
+ }
if( str[j] == L'\0' )
{
+ /* We matched the entire sequence */
return input_exec_binding( m, m.seq );
}
else
{
+ int k;
/*
Return the read characters
*/