mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
fix history load speed on startup
This commit is contained in:
parent
5acbf751c0
commit
1788285ccb
1 changed files with 7 additions and 2 deletions
|
@ -123,8 +123,13 @@ class Pry
|
|||
|
||||
# Load Readline history if required.
|
||||
def self.load_history
|
||||
Readline::HISTORY.push(*File.readlines(history_file).map(&:chomp)) if File.exists?(history_file)
|
||||
@loaded_history = Readline::HISTORY.to_a
|
||||
@loaded_history = []
|
||||
if File.exists?(history_file)
|
||||
File.foreach(history_file) do |line|
|
||||
Readline::HISTORY << line.chomp
|
||||
@loaded_history << line.chomp
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# Save new lines of Readline history if required.
|
||||
|
|
Loading…
Add table
Reference in a new issue