From: nyov Date: Sat, 3 Dec 2011 17:29:06 +0000 (+0100) Subject: console: CTRL+SHIFT+ARROW breaks on underscore for long_cvar_lines X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=203ab14521ebb2f45578f4dfcd93a57a142b632e;p=xonotic%2Fdarkplaces.git console: CTRL+SHIFT+ARROW breaks on underscore for long_cvar_lines I tried making this less code bloat with a loop but utterly failed. --- diff --git a/keys.c b/keys.c index 2369407f..123746ed 100644 --- a/keys.c +++ b/keys.c @@ -889,16 +889,32 @@ Key_Console (int key, int unicode) while(--pos) { k = key_line[pos]; - if (!(k == '\"' || k == ';' || k == ' ' || k == '\'')) - break; + if (keydown[K_SHIFT]) // nyov: backtracking in very_long_grouped_cvar_strangeness (ctrl+k helps) + { + if (!(k == '\"' || k == ';' || k == ' ' || k == '\'' || k == '_')) + break; + } + else + { + if (!(k == '\"' || k == ';' || k == ' ' || k == '\'')) + break; + } } if(pos) while(--pos) { k = key_line[pos]; - if(k == '\"' || k == ';' || k == ' ' || k == '\'') - break; + if (keydown[K_SHIFT]) + { + if(k == '\"' || k == ';' || k == ' ' || k == '\'' || k == '_') + break; + } + else + { + if(k == '\"' || k == ';' || k == ' ' || k == '\'') + break; + } } key_linepos = pos + 1; } @@ -975,16 +991,32 @@ Key_Console (int key, int unicode) while(++pos < len) { k = key_line[pos]; - if(k == '\"' || k == ';' || k == ' ' || k == '\'') - break; + if (keydown[K_SHIFT]) // nyov: backtracking in very_long_grouped_cvar_strangeness (ctrl+k helps) + { + if(k == '\"' || k == ';' || k == ' ' || k == '\'' || k == '_') + break; + } + else + { + if(k == '\"' || k == ';' || k == ' ' || k == '\'') + break; + } } if (pos < len) // skip all "; ' after the word while(++pos < len) { k = key_line[pos]; - if (!(k == '\"' || k == ';' || k == ' ' || k == '\'')) - break; + if (keydown[K_SHIFT]) // nyov: backtracking in very_long_grouped_cvar_strangeness (ctrl+k helps) + { + if (!(k == '\"' || k == ';' || k == ' ' || k == '\'' || k == '_')) + break; + } + else + { + if (!(k == '\"' || k == ';' || k == ' ' || k == '\'')) + break; + } } key_linepos = pos; }