diff options
author | Stan Lo <stan.lo@shopify.com> | 2022-12-04 11:16:27 +0000 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2022-12-05 03:14:55 +0000 |
commit | 16b2e0301411531a6ced6c673a1f9bd41d7b7e3e (patch) | |
tree | d0bd8bf5d34d26c6b2cd7fd44d5ac1532e0a01cd /lib/reline.rb | |
parent | 06cc30b1898d7536f7024b9d4c7f22ec6a967c15 (diff) | |
download | ruby-16b2e0301411531a6ced6c673a1f9bd41d7b7e3e.tar.gz |
[ruby/reline] Remove unapproved color setting APIs
These APIs/configs are not approved by the Ruby core, so they can't be
released to the public. This means having them in the codebase will
block other fixes/features from being released as well.
So this commit removes those exposed interfaces to unblock the release.
Hopefully when https://bugs.ruby-lang.org/issues/18996 is approved we
can re-implement better APIs.
https://github.com/ruby/reline/commit/f7a961c550
Diffstat (limited to 'lib/reline.rb')
-rw-r--r-- | lib/reline.rb | 31 |
1 files changed, 5 insertions, 26 deletions
diff --git a/lib/reline.rb b/lib/reline.rb index f22b573e6d..7800a281ce 100644 --- a/lib/reline.rb +++ b/lib/reline.rb @@ -46,21 +46,6 @@ module Reline keyword_init: true ) - DIALOG_COLOR_APIS = [ - :dialog_default_bg_color, - :dialog_default_bg_color_sequence, - :dialog_default_bg_color=, - :dialog_default_fg_color, - :dialog_default_fg_color_sequence, - :dialog_default_fg_color=, - :dialog_highlight_bg_color, - :dialog_highlight_bg_color_sequence, - :dialog_highlight_bg_color=, - :dialog_highlight_fg_color, - :dialog_highlight_fg_color_sequence, - :dialog_highlight_fg_color= - ] - class Core ATTR_READER_NAMES = %i( completion_append_character @@ -87,8 +72,7 @@ module Reline extend Forwardable def_delegators :config, :autocompletion, - :autocompletion=, - *DIALOG_COLOR_APIS + :autocompletion= def initialize self.output = STDOUT @@ -272,10 +256,10 @@ module Reline contents: result, scrollbar: true, height: 15, - bg_color: config.dialog_default_bg_color_sequence, - pointer_bg_color: config.dialog_highlight_bg_color_sequence, - fg_color: config.dialog_default_fg_color_sequence, - pointer_fg_color: config.dialog_highlight_fg_color_sequence + bg_color: 46, + pointer_bg_color: 45, + fg_color: 37, + pointer_fg_color: 37 ) } Reline::DEFAULT_DIALOG_CONTEXT = Array.new @@ -561,7 +545,6 @@ module Reline def_single_delegators :core, :add_dialog_proc def_single_delegators :core, :dialog_proc def_single_delegators :core, :autocompletion, :autocompletion= - def_single_delegators :core, *DIALOG_COLOR_APIS def_single_delegators :core, :readmultiline def_instance_delegators self, :readmultiline @@ -584,10 +567,6 @@ module Reline core.filename_quote_characters = "" core.special_prefixes = "" core.add_dialog_proc(:autocomplete, Reline::DEFAULT_DIALOG_PROC_AUTOCOMPLETE, Reline::DEFAULT_DIALOG_CONTEXT) - core.dialog_default_bg_color = :cyan - core.dialog_default_fg_color = :white - core.dialog_highlight_bg_color = :magenta - core.dialog_highlight_fg_color = :white } end |