mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
helpers/text: respect RL_PROMPT_START_IGNORE and RL_PROMPT_END_IGNORE
Addresses to #493. Fixes the described bug in the situation when you use helper methods in your Pry prompt like this: Pry.prompt = [ proc { |_, _, _| Pry::Helpers::Text.red("YO > ") }, proc { |_, _, _| "| "} ]
This commit is contained in:
parent
df3fc3ee8c
commit
a293f1f3aa
1 changed files with 2 additions and 3 deletions
|
@ -18,11 +18,11 @@ class Pry
|
|||
|
||||
COLORS.each_pair do |color, value|
|
||||
define_method color do |text|
|
||||
"\033[0;#{30+value}m#{text}\033[0m"
|
||||
"\001\033[0;#{30+value}m\002#{text}\001\033[0m\002"
|
||||
end
|
||||
|
||||
define_method "bright_#{color}" do |text|
|
||||
"\033[1;#{30+value}m#{text}\033[0m"
|
||||
"\001\033[1;#{30+value}m\002#{text}\001\033[0m\002"
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -98,4 +98,3 @@ class Pry
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue