Skip to content

Commit 0d598d4

Browse files
committed
(all) Remove compatibility code for silencing with Vimscript variables.
1 parent ab3a2c3 commit 0d598d4

10 files changed

+10
-140
lines changed

lua/mini/ai.lua

+1-14
Original file line numberDiff line numberDiff line change
@@ -1249,19 +1249,6 @@ end
12491249

12501250
H.is_disabled = function() return vim.g.miniai_disable == true or vim.b.miniai_disable == true end
12511251

1252-
-- TODO: Remove **before** releasing 0.8.0
1253-
H.is_silenced = function()
1254-
if vim.g.miniai_silence == true or vim.b.miniai_silence == true then
1255-
vim.notify_once(
1256-
"(mini.ai) Vimscript variables for silencing 'mini.nvim' modules are deprecated."
1257-
.. ' Use `config.silent` and buffer-local config.'
1258-
)
1259-
return true
1260-
end
1261-
1262-
return H.get_config().silent
1263-
end
1264-
12651252
H.get_config =
12661253
function(config) return vim.tbl_deep_extend('force', MiniAi.config, vim.b.miniai_config or {}, config or {}) end
12671254

@@ -1950,7 +1937,7 @@ end
19501937

19511938
-- Utilities ------------------------------------------------------------------
19521939
H.echo = function(msg, is_important)
1953-
if H.is_silenced() then return end
1940+
if H.get_config().silent then return end
19541941

19551942
-- Construct message chunks
19561943
msg = type(msg) == 'string' and { { msg } } or msg

lua/mini/align.lua

+1-14
Original file line numberDiff line numberDiff line change
@@ -1361,19 +1361,6 @@ end
13611361

13621362
H.is_disabled = function() return vim.g.minialign_disable == true or vim.b.minialign_disable == true end
13631363

1364-
-- TODO: Remove **before** releasing 0.8.0
1365-
H.is_silenced = function()
1366-
if vim.g.minialign_silence == true or vim.b.minialign_silence == true then
1367-
vim.notify_once(
1368-
"(mini.align) Vimscript variables for silencing 'mini.nvim' modules are deprecated."
1369-
.. ' Use `config.silent` and buffer-local config.'
1370-
)
1371-
return true
1372-
end
1373-
1374-
return H.get_config().silent
1375-
end
1376-
13771364
H.get_config =
13781365
function(config) return vim.tbl_deep_extend('force', MiniAlign.config, vim.b.minialign_config or {}, config or {}) end
13791366

@@ -1946,7 +1933,7 @@ end
19461933

19471934
-- Utilities ------------------------------------------------------------------
19481935
H.echo = function(msg, add_to_history)
1949-
if H.is_silenced() then return end
1936+
if H.get_config().silent then return end
19501937

19511938
-- Construct message chunks
19521939
msg = type(msg) == 'string' and { { msg } } or msg

lua/mini/basics.lua

+1-14
Original file line numberDiff line numberDiff line change
@@ -434,19 +434,6 @@ H.apply_config = function(config)
434434
H.apply_autocommands(config)
435435
end
436436

437-
-- TODO: Remove **before** releasing 0.8.0
438-
H.is_silenced = function()
439-
if vim.g.minibasics_silence == true or vim.b.minibasics_silence == true then
440-
vim.notify_once(
441-
"(mini.basics) Vimscript variables for silencing 'mini.nvim' modules are deprecated."
442-
.. ' Use `config.silent` and buffer-local config.'
443-
)
444-
return true
445-
end
446-
447-
return MiniBasics.config.silent
448-
end
449-
450437
-- Options --------------------------------------------------------------------
451438
--stylua: ignore
452439
H.apply_options = function(config)
@@ -608,7 +595,7 @@ H.apply_mappings = function(config)
608595
if type(toggle_prefix) == 'string' and toggle_prefix ~= '' then
609596
local map_toggle = function(lhs, rhs, desc) map('n', toggle_prefix .. lhs, rhs, { desc = desc }) end
610597

611-
if H.is_silenced() then
598+
if config.silent then
612599
-- Toggle without feedback
613600
map_toggle('b', '<Cmd>lua vim.o.bg = vim.o.bg == "dark" and "light" or "dark"<CR>', "Toggle 'background'")
614601
map_toggle('c', '<Cmd>setlocal cursorline!<CR>', "Toggle 'cursorline'")

lua/mini/bufremove.lua

+1-14
Original file line numberDiff line numberDiff line change
@@ -204,19 +204,6 @@ end
204204

205205
H.is_disabled = function() return vim.g.minibufremove_disable == true or vim.b.minibufremove_disable == true end
206206

207-
-- TODO: Remove **before** releasing 0.8.0
208-
H.is_silenced = function()
209-
if vim.g.minibufremove_silence == true or vim.b.minibufremove_silence == true then
210-
vim.notify_once(
211-
"(mini.bufremove) Vimscript variables for silencing 'mini.nvim' modules are deprecated."
212-
.. ' Use `config.silent` and buffer-local config.'
213-
)
214-
return true
215-
end
216-
217-
return MiniBufremove.config.silent
218-
end
219-
220207
-- Removing implementation ----------------------------------------------------
221208
H.unshow_and_cmd = function(buf_id, force, cmd)
222209
buf_id = H.normalize_buf_id(buf_id)
@@ -260,7 +247,7 @@ end
260247

261248
-- Utilities ------------------------------------------------------------------
262249
H.echo = function(msg, is_important)
263-
if H.is_silenced() then return end
250+
if MiniBufremove.config.silent then return end
264251

265252
-- Construct message chunks
266253
msg = type(msg) == 'string' and { { msg } } or msg

lua/mini/doc.lua

+1-14
Original file line numberDiff line numberDiff line change
@@ -778,19 +778,6 @@ end
778778

779779
H.apply_config = function(config) MiniDoc.config = config end
780780

781-
-- TODO: Remove **before** releasing 0.8.0
782-
H.is_silenced = function()
783-
if vim.g.minidoc_silence == true or vim.b.minidoc_silence == true then
784-
vim.notify_once(
785-
"(mini.doc) Vimscript variables for silencing 'mini.nvim' modules are deprecated."
786-
.. ' Use `config.silent` and buffer-local config.'
787-
)
788-
return true
789-
end
790-
791-
return H.get_config().silent
792-
end
793-
794781
H.get_config =
795782
function(config) return vim.tbl_deep_extend('force', MiniDoc.config, vim.b.minidoc_config or {}, config or {}) end
796783

@@ -1283,7 +1270,7 @@ end
12831270

12841271
-- Utilities ------------------------------------------------------------------
12851272
H.echo = function(msg, is_important)
1286-
if H.is_silenced() then return end
1273+
if H.get_config().silent then return end
12871274

12881275
-- Construct message chunks
12891276
msg = type(msg) == 'string' and { { msg } } or msg

lua/mini/jump.lua

+1-14
Original file line numberDiff line numberDiff line change
@@ -382,19 +382,6 @@ end
382382

383383
H.is_disabled = function() return vim.g.minijump_disable == true or vim.b.minijump_disable == true end
384384

385-
-- TODO: Remove **before** releasing 0.8.0
386-
H.is_silenced = function()
387-
if vim.g.minijump_silence == true or vim.b.minijump_silence == true then
388-
vim.notify_once(
389-
"(mini.jump) Vimscript variables for silencing 'mini.nvim' modules are deprecated."
390-
.. ' Use `config.silent` and buffer-local config.'
391-
)
392-
return true
393-
end
394-
395-
return H.get_config().silent
396-
end
397-
398385
H.get_config =
399386
function(config) return vim.tbl_deep_extend('force', MiniJump.config, vim.b.minijump_config or {}, config or {}) end
400387

@@ -484,7 +471,7 @@ end
484471

485472
-- Utilities ------------------------------------------------------------------
486473
H.echo = function(msg, is_important)
487-
if H.is_silenced() then return end
474+
if H.get_config().silent then return end
488475

489476
-- Construct message chunks
490477
msg = type(msg) == 'string' and { { msg } } or msg

lua/mini/jump2d.lua

+1-14
Original file line numberDiff line numberDiff line change
@@ -688,19 +688,6 @@ end
688688

689689
H.is_disabled = function() return vim.g.minijump2d_disable == true or vim.b.minijump2d_disable == true end
690690

691-
-- TODO: Remove **before** releasing 0.8.0
692-
H.is_silenced = function()
693-
if vim.g.minijump2d_silence == true or vim.b.minijump2d_silence == true then
694-
vim.notify_once(
695-
"(mini.jump2d) Vimscript variables for silencing 'mini.nvim' modules are deprecated."
696-
.. ' Use `config.silent` and buffer-local config.'
697-
)
698-
return true
699-
end
700-
701-
return H.get_config().silent
702-
end
703-
704691
H.get_config = function(config)
705692
return vim.tbl_deep_extend('force', MiniJump2d.config, vim.b.minijump2d_config or {}, config or {})
706693
end
@@ -980,7 +967,7 @@ end
980967

981968
-- Utilities ------------------------------------------------------------------
982969
H.echo = function(msg, is_important)
983-
if H.is_silenced() then return end
970+
if H.get_config().silent then return end
984971

985972
-- Construct message chunks
986973
msg = type(msg) == 'string' and { { msg } } or msg

lua/mini/starter.lua

+1-14
Original file line numberDiff line numberDiff line change
@@ -1056,19 +1056,6 @@ H.apply_config = function(config) MiniStarter.config = config end
10561056

10571057
H.is_disabled = function() return vim.g.ministarter_disable == true or vim.b.ministarter_disable == true end
10581058

1059-
-- TODO: Remove **before** releasing 0.8.0
1060-
H.is_silenced = function()
1061-
if vim.g.ministarter_silence == true or vim.b.ministarter_silence == true then
1062-
vim.notify_once(
1063-
"(mini.starter) Vimscript variables for silencing 'mini.nvim' modules are deprecated."
1064-
.. ' Use `config.silent` and buffer-local config.'
1065-
)
1066-
return true
1067-
end
1068-
1069-
return H.get_config().silent
1070-
end
1071-
10721059
H.get_config = function(config)
10731060
return vim.tbl_deep_extend('force', MiniStarter.config, vim.b.ministarter_config or {}, config or {})
10741061
end
@@ -1443,7 +1430,7 @@ end
14431430

14441431
-- Utilities ------------------------------------------------------------------
14451432
H.echo = function(msg, is_important)
1446-
if H.is_silenced() then return end
1433+
if H.get_config().silent then return end
14471434

14481435
-- Construct message chunks
14491436
msg = type(msg) == 'string' and { { msg } } or msg

lua/mini/surround.lua

+1-14
Original file line numberDiff line numberDiff line change
@@ -1179,19 +1179,6 @@ end
11791179

11801180
H.is_disabled = function() return vim.g.minisurround_disable == true or vim.b.minisurround_disable == true end
11811181

1182-
-- TODO: Remove **before** releasing 0.8.0
1183-
H.is_silenced = function()
1184-
if vim.g.minisurround_silence == true or vim.b.minisurround_silence == true then
1185-
vim.notify_once(
1186-
"(mini.surround) Vimscript variables for silencing 'mini.nvim' modules are deprecated."
1187-
.. ' Use `config.silent` and buffer-local config.'
1188-
)
1189-
return true
1190-
end
1191-
1192-
return H.get_config().silent
1193-
end
1194-
11951182
H.get_config = function(config)
11961183
return vim.tbl_deep_extend('force', MiniSurround.config, vim.b.minisurround_config or {}, config or {})
11971184
end
@@ -2115,7 +2102,7 @@ end
21152102

21162103
-- Utilities ------------------------------------------------------------------
21172104
H.echo = function(msg, is_important)
2118-
if H.is_silenced() then return end
2105+
if H.get_config().silent then return end
21192106

21202107
-- Construct message chunks
21212108
msg = type(msg) == 'string' and { { msg } } or msg

lua/mini/test.lua

+1-14
Original file line numberDiff line numberDiff line change
@@ -1635,19 +1635,6 @@ H.apply_config = function(config) MiniTest.config = config end
16351635

16361636
H.is_disabled = function() return vim.g.minitest_disable == true or vim.b.minitest_disable == true end
16371637

1638-
-- TODO: Remove **before** releasing 0.8.0
1639-
H.is_silenced = function()
1640-
if vim.g.minitest_silence == true or vim.b.minitest_silence == true then
1641-
vim.notify_once(
1642-
"(mini.test) Vimscript variables for silencing 'mini.nvim' modules are deprecated."
1643-
.. ' Use `config.silent` and buffer-local config.'
1644-
)
1645-
return true
1646-
end
1647-
1648-
return H.get_config().silent
1649-
end
1650-
16511638
H.get_config =
16521639
function(config) return vim.tbl_deep_extend('force', MiniTest.config, vim.b.minitest_config or {}, config or {}) end
16531640

@@ -2257,7 +2244,7 @@ end
22572244

22582245
-- Utilities ------------------------------------------------------------------
22592246
H.echo = function(msg, is_important)
2260-
if H.is_silenced() then return end
2247+
if H.get_config().silent then return end
22612248

22622249
-- Construct message chunks
22632250
msg = type(msg) == 'string' and { { msg } } or msg

0 commit comments

Comments
 (0)