mirror of
				https://github.com/neovim/neovim.git
				synced 2025-10-26 12:27:24 +00:00 
			
		
		
		
	fix(ui-ext): send title to newly-attached UI
This commit is contained in:
		| @@ -3444,7 +3444,6 @@ void resettitle(void) | |||||||
| { | { | ||||||
|   ui_call_set_icon(cstr_as_string(lasticon)); |   ui_call_set_icon(cstr_as_string(lasticon)); | ||||||
|   ui_call_set_title(cstr_as_string(lasttitle)); |   ui_call_set_title(cstr_as_string(lasttitle)); | ||||||
|   ui_flush(); |  | ||||||
| } | } | ||||||
|  |  | ||||||
| #if defined(EXITFREE) | #if defined(EXITFREE) | ||||||
|   | |||||||
| @@ -4875,9 +4875,6 @@ static void ex_stop(exarg_T *eap) | |||||||
|   ui_call_suspend(); |   ui_call_suspend(); | ||||||
|   ui_flush(); |   ui_flush(); | ||||||
|  |  | ||||||
|   maketitle(); |  | ||||||
|   resettitle();  // force updating the title |  | ||||||
|   ui_refresh();  // may have resized window |  | ||||||
|   apply_autocmds(EVENT_VIMRESUME, NULL, NULL, false, NULL); |   apply_autocmds(EVENT_VIMRESUME, NULL, NULL, false, NULL); | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -15,7 +15,7 @@ | |||||||
| #include "nvim/api/ui.h" | #include "nvim/api/ui.h" | ||||||
| #include "nvim/ascii.h" | #include "nvim/ascii.h" | ||||||
| #include "nvim/autocmd.h" | #include "nvim/autocmd.h" | ||||||
| #include "nvim/buffer_defs.h" | #include "nvim/buffer.h" | ||||||
| #include "nvim/cursor_shape.h" | #include "nvim/cursor_shape.h" | ||||||
| #include "nvim/drawscreen.h" | #include "nvim/drawscreen.h" | ||||||
| #include "nvim/ex_getln.h" | #include "nvim/ex_getln.h" | ||||||
| @@ -348,6 +348,7 @@ void ui_attach_impl(UI *ui, uint64_t chanid) | |||||||
|  |  | ||||||
|   uis[ui_count++] = ui; |   uis[ui_count++] = ui; | ||||||
|   ui_refresh_options(); |   ui_refresh_options(); | ||||||
|  |   resettitle(); | ||||||
|  |  | ||||||
|   for (UIExtension i = kUIGlobalCount; (int)i < kUIExtCount; i++) { |   for (UIExtension i = kUIGlobalCount; (int)i < kUIExtCount; i++) { | ||||||
|     ui_set_ext_option(ui, i, ui->ui_ext[i]); |     ui_set_ext_option(ui, i, ui->ui_ext[i]); | ||||||
|   | |||||||
| @@ -117,6 +117,12 @@ local function screen_tests(linegrid) | |||||||
|       screen:expect(function() |       screen:expect(function() | ||||||
|         eq(expected, screen.title) |         eq(expected, screen.title) | ||||||
|       end) |       end) | ||||||
|  |       screen:detach() | ||||||
|  |       screen.title = nil | ||||||
|  |       screen:attach() | ||||||
|  |       screen:expect(function() | ||||||
|  |         eq(expected, screen.title) | ||||||
|  |       end) | ||||||
|     end) |     end) | ||||||
|   end) |   end) | ||||||
|  |  | ||||||
| @@ -128,6 +134,12 @@ local function screen_tests(linegrid) | |||||||
|       screen:expect(function() |       screen:expect(function() | ||||||
|         eq(expected, screen.icon) |         eq(expected, screen.icon) | ||||||
|       end) |       end) | ||||||
|  |       screen:detach() | ||||||
|  |       screen.icon = nil | ||||||
|  |       screen:attach() | ||||||
|  |       screen:expect(function() | ||||||
|  |         eq(expected, screen.icon) | ||||||
|  |       end) | ||||||
|     end) |     end) | ||||||
|   end) |   end) | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 zeertzjq
					zeertzjq