1
0
Fork 0
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:
Kyrylo Silin 2015-03-05 12:39:26 +02:00
parent df3fc3ee8c
commit a293f1f3aa

View file

@ -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