Skip to content

Commit 14784ed

Browse files
authored
Remove unused variables (#739)
1 parent c892885 commit 14784ed

File tree

2 files changed

+16
-32
lines changed

2 files changed

+16
-32
lines changed

lib/reline/config.rb

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -245,22 +245,6 @@ def bind_variable(name, value, raw_value)
245245
rescue ArgumentError
246246
@history_size = 500
247247
end
248-
when 'bell-style'
249-
@bell_style =
250-
case value
251-
when 'none', 'off'
252-
:none
253-
when 'audible', 'on'
254-
:audible
255-
when 'visible'
256-
:visible
257-
else
258-
:audible
259-
end
260-
when 'comment-begin'
261-
@comment_begin = value.dup
262-
when 'completion-query-items'
263-
@completion_query_items = value.to_i
264248
when 'isearch-terminators'
265249
@isearch_terminators = retrieve_string(raw_value)
266250
when 'editing-mode'

test/reline/test_config.rb

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ def registered_key_bindings(keys)
3333

3434
def test_read_lines
3535
@config.read_lines(<<~LINES.lines)
36-
set bell-style on
36+
set show-mode-in-prompt on
3737
LINES
3838

39-
assert_equal :audible, @config.instance_variable_get(:@bell_style)
39+
assert_equal true, @config.instance_variable_get(:@show_mode_in_prompt)
4040
end
4141

4242
def test_read_lines_with_variable
@@ -160,69 +160,69 @@ def test_bind_key_with_hexadecimal_number
160160
def test_include
161161
File.open('included_partial', 'wt') do |f|
162162
f.write(<<~PARTIAL_LINES)
163-
set bell-style on
163+
set show-mode-in-prompt on
164164
PARTIAL_LINES
165165
end
166166
@config.read_lines(<<~LINES.lines)
167167
$include included_partial
168168
LINES
169169

170-
assert_equal :audible, @config.instance_variable_get(:@bell_style)
170+
assert_equal true, @config.instance_variable_get(:@show_mode_in_prompt)
171171
end
172172

173173
def test_include_expand_path
174174
home_backup = ENV['HOME']
175175
File.open('included_partial', 'wt') do |f|
176176
f.write(<<~PARTIAL_LINES)
177-
set bell-style on
177+
set show-mode-in-prompt on
178178
PARTIAL_LINES
179179
end
180180
ENV['HOME'] = Dir.pwd
181181
@config.read_lines(<<~LINES.lines)
182182
$include ~/included_partial
183183
LINES
184184

185-
assert_equal :audible, @config.instance_variable_get(:@bell_style)
185+
assert_equal true, @config.instance_variable_get(:@show_mode_in_prompt)
186186
ensure
187187
ENV['HOME'] = home_backup
188188
end
189189

190190
def test_if
191191
@config.read_lines(<<~LINES.lines)
192192
$if Ruby
193-
set bell-style audible
193+
set vi-cmd-mode-string (cmd)
194194
$else
195-
set bell-style visible
195+
set vi-cmd-mode-string [cmd]
196196
$endif
197197
LINES
198198

199-
assert_equal :audible, @config.instance_variable_get(:@bell_style)
199+
assert_equal '(cmd)', @config.instance_variable_get(:@vi_cmd_mode_string)
200200
end
201201

202202
def test_if_with_false
203203
@config.read_lines(<<~LINES.lines)
204204
$if Python
205-
set bell-style audible
205+
set vi-cmd-mode-string (cmd)
206206
$else
207-
set bell-style visible
207+
set vi-cmd-mode-string [cmd]
208208
$endif
209209
LINES
210210

211-
assert_equal :visible, @config.instance_variable_get(:@bell_style)
211+
assert_equal '[cmd]', @config.instance_variable_get(:@vi_cmd_mode_string)
212212
end
213213

214214
def test_if_with_indent
215215
%w[Ruby Reline].each do |cond|
216216
@config.read_lines(<<~LINES.lines)
217-
set bell-style none
217+
set vi-cmd-mode-string {cmd}
218218
$if #{cond}
219-
set bell-style audible
219+
set vi-cmd-mode-string (cmd)
220220
$else
221-
set bell-style visible
221+
set vi-cmd-mode-string [cmd]
222222
$endif
223223
LINES
224224

225-
assert_equal :audible, @config.instance_variable_get(:@bell_style)
225+
assert_equal '(cmd)', @config.instance_variable_get(:@vi_cmd_mode_string)
226226
end
227227
end
228228

0 commit comments

Comments
 (0)