Added the gnu readline module to read
Now you can use the vi mode editing putting set editing-mode vi in your ~/.inputrc :-) That's rocks.
This commit is contained in:
parent
2185e92e65
commit
6983132d31
1 changed files with 2 additions and 3 deletions
5
ytodo.rb
5
ytodo.rb
|
@ -1,6 +1,7 @@
|
|||
#!/usr/bin/env ruby
|
||||
|
||||
require "todolist.rb"
|
||||
require 'readline'
|
||||
|
||||
# this file run the minimal GUI
|
||||
#
|
||||
|
@ -19,9 +20,7 @@ end
|
|||
if __FILE__ == $0:
|
||||
todoList=TodoList.new
|
||||
todoList.load defaultTaskFile
|
||||
while true:
|
||||
print "> "
|
||||
entry=STDIN.gets.chomp
|
||||
while entry = Readline.readline('> ',true):
|
||||
case entry
|
||||
when /^(a|\+|add) / # ça commence par 'a ' '+ ' ou 'add '
|
||||
todoList.addTask( Task.new(entry.sub(/^(a|\+|add) /,"")) )
|
||||
|
|
Loading…
Reference in a new issue