Skip to content

Commit

Permalink
fixed tab completion on ENTER
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesse McClure committed Nov 4, 2013
1 parent 8bf3f5b commit 1f20c89
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions interrobang.c
Expand Up @@ -389,20 +389,22 @@ static int main_loop() {
}
pclose(compgen);
if (complist) compcheck = True;
compcur = -1;
compcur = 0;
}
if ( compcheck && key == XK_Tab || key == XK_ISO_Left_Tab ||
key == XK_Down || key == XK_Up) {
// if ( (key==XK_Tab||key==XK_ISO_Left_Tab)&&compcount ) {
// if (compcur == -1) compcur = 0;
// strcpy(line,complist[compcur]);
// pos = strlen(line);
// }
/*else*/ if ( key==XK_ISO_Left_Tab || key == XK_Up ) {
if (compcur || pos == strlen(complist[compcur])) {
// if ( (key==XK_Tab||key==XK_ISO_Left_Tab)&&compcount ) {
// if (compcur == -1) compcur = 0;
// strcpy(line,complist[compcur]);
// pos = strlen(line);
// }
/*else*/ if ( key==XK_ISO_Left_Tab || key == XK_Up ) {
if ((--compcur) < 0 ) compcur = compcount - 1;
}
else if ( (++compcur) >= compcount ) {
compcur = 0;
}
else if ( (++compcur) >= compcount ) {
compcur = 0;
}
}
strcpy(line,complist[compcur]);
pos = strlen(line);
Expand Down

0 comments on commit 1f20c89

Please sign in to comment.