Ignore:
Timestamp:
2009-04-13T21:15:58Z (15 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c822026
Parents:
a1d89ad
Message:

fix tab completion in kconsole (this resolves ticket #21)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/console/kconsole.c

    ra1d89ad r37c312a  
    303303                                continue;
    304304                       
     305                        if (found > 1) {
     306                                /* No unique hint, list was printed */
     307                                printf("%s> ", prompt);
     308                                printf("%ls", current);
     309                                print_cc('\b', wstr_length(current) - position);
     310                                continue;
     311                        }
     312                       
     313                        /* We have a hint */
     314                       
    305315                        size_t off = 0;
    306316                        count_t i = 0;
     
    311321                        }
    312322                       
    313                         if ((str_length(tmp) > 0) || (found == 1)) {
    314                                 /* We have a hint */
    315                                 printf("%ls", current + position);
    316                                 print_cc('\b', wstr_length(current) - position);
    317                                 position += str_length(tmp);
    318                                
    319                                 if ((found == 1) && (position == wstr_length(current))) {
    320                                         if (wstr_linsert(current, ' ', position, MAX_CMDLINE)) {
    321                                                 printf("%ls", current + position);
    322                                                 position++;
    323                                         }
     323                        printf("%ls", current + position);
     324                        position += str_length(tmp);
     325                        print_cc('\b', wstr_length(current) - position);
     326                       
     327                        if (position == wstr_length(current)) {
     328                                /* Insert a space after the last completed argument */
     329                                if (wstr_linsert(current, ' ', position, MAX_CMDLINE)) {
     330                                        printf("%ls", current + position);
     331                                        position++;
    324332                                }
    325                         } else {
    326                                 /* No unique hint, list was printed */
    327                                 printf("%s> ", prompt);
    328                                 printf("%ls", current);
    329                                 position += str_length(tmp);
    330                         }
    331                        
    332                         print_cc('\b', wstr_length(current) - position);
     333                        }
    333334                        continue;
    334335                }
Note: See TracChangeset for help on using the changeset viewer.