Simplify history saving code
This commit is contained in:
parent
eed9db39e5
commit
0af897ab59
@ -106,14 +106,7 @@ module IRB
|
|||||||
end
|
end
|
||||||
|
|
||||||
open(history_file, 'w', 0600 ) do |f|
|
open(history_file, 'w', 0600 ) do |f|
|
||||||
hist = history.map { |l|
|
hist = history.map{ |l| l.split("\n").join("\\\n") }
|
||||||
split_lines = l.split("\n")
|
|
||||||
if split_lines.size == 1
|
|
||||||
l
|
|
||||||
else
|
|
||||||
split_lines.join("\\\n")
|
|
||||||
end
|
|
||||||
}
|
|
||||||
f.puts(hist[-num..-1] || hist)
|
f.puts(hist[-num..-1] || hist)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user