Scala -jline file completer causes file not found (linux) -


i'm seeing bizarre in piece of code.

    command match {       case "q" | "quit" =>  done=true       case "f" | "file" =>         { //        console_reader.addcompleter(fn_completer)           val f:string=console_reader.readline("input filename >")           val filename=             if(java.nio.file.paths.get(f).isabsolute())               f             else               system.getproperty("user.dir")+"/"+f           val ft=paths.get(filename).tostring()           console_reader.println(ft)           if(files.exists(paths.get(filename)))              process_file(filename)           else             console_reader.println(filename+" not exist") //        console_reader.removecompleter(fn_completer)     }   case _ => console_reader.println(command+" not command") } 

when run , type build.sbt fine--process_file called. when uncomment file completer lines, same file reported not existing. what's up?

after reading line, place console_reader.println(":"+f+":") , becomes apparent completer , using tab completion, space appended filename.

i changed line val f=console_reader.readline("input filename >").striplineend.trim() , fixed things.