@@ -6,25 +6,24 @@ local migrations = {}
66
77M .show_migrations = function ()
88 if # migrations > 0 then
9- for i , message in ipairs (migrations ) do
10- migrations [i ] = " * " .. message
9+ local content = {}
10+ for _ , message in ipairs (migrations ) do
11+ vim .list_extend (content , vim .split (" \n ## " .. message , " \n " , { trimempty = false }))
1112 end
12- table.insert (
13- migrations ,
14- 1 ,
15- " # Neo-tree configuration has been updated. Please review the changes below."
16- )
13+ local header = " # Neo-tree configuration has been updated. Please review the changes below."
14+ table.insert (content , 1 , header )
1715 local buf = vim .api .nvim_create_buf (false , true )
18- vim .api .nvim_buf_set_lines (buf , 0 , - 1 , false , migrations )
16+ vim .api .nvim_buf_set_lines (buf , 0 , - 1 , false , content )
1917 vim .api .nvim_buf_set_option (buf , " buftype" , " nofile" )
18+ vim .api .nvim_buf_set_option (buf , " wrap" , true )
2019 vim .api .nvim_buf_set_option (buf , " bufhidden" , " wipe" )
2120 vim .api .nvim_buf_set_option (buf , " buflisted" , false )
2221 vim .api .nvim_buf_set_option (buf , " swapfile" , false )
2322 vim .api .nvim_buf_set_option (buf , " modifiable" , false )
2423 vim .api .nvim_buf_set_option (buf , " filetype" , " markdown" )
2524 vim .api .nvim_buf_set_name (buf , " Neo-tree migrations" )
2625 vim .defer_fn (function ()
27- vim .cmd (string.format (" %ssplit" , # migrations ))
26+ vim .cmd (string.format (" %ssplit" , # content ))
2827 vim .api .nvim_win_set_buf (0 , buf )
2928 end , 100 )
3029 end
@@ -60,11 +59,12 @@ M.migrate = function(config)
6059 end
6160 end
6261
63- local removed = function (key )
62+ local removed = function (key , desc )
6463 local value = utils .get_value (config , key )
6564 if type (value ) ~= " nil" then
6665 utils .set_value (config , key , nil )
67- migrations [# migrations + 1 ] = string.format (" The `%s` option has been removed." , key )
66+ migrations [# migrations + 1 ] =
67+ string.format (" The `%s` option has been removed.\n %s" , key , desc or " " )
6868 end
6969 end
7070
@@ -106,6 +106,30 @@ M.migrate = function(config)
106106 -- v3.x
107107 removed (" close_floats_on_escape_key" )
108108
109+ -- v4.x
110+ removed (
111+ " enable_normal_mode_for_inputs" ,
112+ [[
113+ Please use `neo_tree_popup_input_ready` event instead and call `stopinsert` inside the handler.
114+ <https://github.com/nvim-neo-tree/neo-tree.nvim/pull/1372>
115+
116+ See instructions in `:h neo-tree-events` for more details.
117+
118+ ```lua
119+ event_handlers = {
120+ {
121+ event = "neo_tree_popup_input_ready",
122+ ---@param input NuiInput
123+ handler = function(input)
124+ -- enter input popup with normal mode by default.
125+ vim.cmd("stopinsert")
126+ end,
127+ }
128+ }
129+ ```
130+ ]]
131+ )
132+
109133 return migrations
110134end
111135
0 commit comments