mirror of
				https://github.com/neovim/neovim.git
				synced 2025-10-26 12:27:24 +00:00 
			
		
		
		
	fix(lua): make ui_attach()/ui_detach() take effect immediately (#20037)
This commit is contained in:
		| @@ -749,7 +749,7 @@ void ui_comp_add_cb(uint32_t ns_id, LuaRef cb, bool *ext_widgets) | |||||||
|   *item = event_cb; |   *item = event_cb; | ||||||
|  |  | ||||||
|   ui_comp_update_ext(); |   ui_comp_update_ext(); | ||||||
|   ui_schedule_refresh(); |   ui_refresh(); | ||||||
| } | } | ||||||
|  |  | ||||||
| void ui_comp_remove_cb(uint32_t ns_id) | void ui_comp_remove_cb(uint32_t ns_id) | ||||||
| @@ -759,5 +759,5 @@ void ui_comp_remove_cb(uint32_t ns_id) | |||||||
|     pmap_del(uint32_t)(&ui_event_cbs, ns_id); |     pmap_del(uint32_t)(&ui_event_cbs, ns_id); | ||||||
|   } |   } | ||||||
|   ui_comp_update_ext(); |   ui_comp_update_ext(); | ||||||
|   ui_schedule_refresh(); |   ui_refresh(); | ||||||
| } | } | ||||||
|   | |||||||
| @@ -88,10 +88,12 @@ describe('vim.ui_attach', function() | |||||||
|        { "popupmenu_hide" }; |        { "popupmenu_hide" }; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     -- ui_detach stops events, and reenables builtin pum |     -- vim.ui_detach() stops events, and reenables builtin pum immediately | ||||||
|     exec_lua [[ vim.ui_detach(ns) ]] |     exec_lua [[ | ||||||
|  |       vim.ui_detach(ns) | ||||||
|  |       vim.fn.complete(1, {'food', 'foobar', 'foo'}) | ||||||
|  |     ]] | ||||||
|  |  | ||||||
|     funcs.complete(1, {'food', 'foobar', 'foo'}) |  | ||||||
|     screen:expect{grid=[[ |     screen:expect{grid=[[ | ||||||
|       food^                                    | |       food^                                    | | ||||||
|       {3:food           }{1:                         }| |       {3:food           }{1:                         }| | ||||||
| @@ -102,6 +104,5 @@ describe('vim.ui_attach', function() | |||||||
|     expect_events { |     expect_events { | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |  | ||||||
|   end) |   end) | ||||||
| end) | end) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 zeertzjq
					zeertzjq