@@ -41,65 +41,6 @@ function M.get_options()
4141 return options
4242end
4343
44- --- @return table
45- local function get_missing_options (opts )
46- return vim .iter (opts ):filter (function (opt ) return not vim .o [opt ] end )
47- end
48-
49- local function warn_missing_options (opts )
50- for _ , opt in pairs (opts ) do
51- if not vim .o [opt ] then
52- local message = string.format (
53- ' Modicator requires `%s` to be set. Run `:set %s` or add `vim.o.%s '
54- .. ' = true` to your init.lua' ,
55- opt ,
56- opt ,
57- opt
58- )
59- require (' modicator.utils' ).warn (message )
60- end
61- end
62- end
63-
64- --- @param opts table
65- local function check_deprecated_config (opts )
66- if opts .highlights and opts .highlights .modes then
67- local message = ' configuration of highlights has changed to highlight '
68- .. ' groups rather than using `highlights.modes`. Check `:help '
69- .. ' modicator-configuration` to see the new configuration API.'
70- require (' modicator.utils' ).warn (message )
71- end
72- end
73-
74- local function show_warnings ()
75- if options .show_warnings then
76- local missing_options = get_missing_options ({
77- ' cursorline' ,
78- ' number' ,
79- ' termguicolors' ,
80- }):totable ()
81-
82- if # missing_options > 0 then
83- warn_missing_options (missing_options )
84-
85- local message = ' If you\' ve you have already set '
86- .. ' those options in your config, this warning is likely '
87- .. ' caused by another plugin temporarily modifying those '
88- .. ' options for this buffer. If Modicator works as expected in '
89- .. ' other buffers you can remove the `show_warnings` option '
90- .. ' from your Modicator configuration.'
91- require (' modicator.utils' ).inform (message )
92- end
93-
94- check_deprecated_config (options )
95- end
96- end
97-
98- local function lualine_is_loaded ()
99- local ok , _ = pcall (require , ' lualine' )
100- return ok
101- end
102-
10344local function mode_name_from_mode (mode )
10445 local mode_names = {
10546 [' n' ] = ' Normal' ,
@@ -175,6 +116,11 @@ local function set_fallback_highlight_groups()
175116 end
176117end
177118
119+ local function lualine_is_loaded ()
120+ local ok , _ = pcall (require , ' lualine' )
121+ return ok
122+ end
123+
178124local function set_highlight_groups ()
179125 if lualine_is_loaded () and options .integration .lualine .enabled then
180126 local mode_section = options .integration .lualine .mode_section
@@ -211,7 +157,7 @@ local function create_autocmds()
211157 -- NOTE: VimEnter loads after user's configuration is loaded
212158 api .nvim_create_autocmd (' VimEnter' , {
213159 callback = function ()
214- show_warnings ()
160+ require ( ' modicator.notifications ' ). show_warnings ()
215161 update_mode ()
216162 end ,
217163 group = augroup ,
0 commit comments