Last active
August 29, 2015 14:25
-
-
Save jbbarth/6793347b404b3559e189 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#type "a", "b", "c", "Enter", "a", "TAB": | |
% crystal test.cr | |
> abc | |
you typed: abc | |
> a | |
autocompleting on: "a" | |
line_buffer is: "abc\n" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# sample code for showing Readline.line_buffer is not updated realtime | |
require "readline" | |
Readline.autocomplete do |text| | |
print! "\nautocompleting on: #{text.inspect}\n" | |
print! "line_buffer is: #{Readline.line_buffer.inspect}\n" | |
[] of String | |
end | |
loop do | |
input = Readline.readline("> ") | |
print! "you typed: #{input}\n" unless input.nil? | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment