This commit is contained in:
glepnir 2024-09-16 23:20:16 +01:00 committed by GitHub
commit cff40c9095
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 18 additions and 1 deletions

View File

@ -35,6 +35,10 @@ void set_title(String title)
FUNC_API_SINCE(3); FUNC_API_SINCE(3);
void set_icon(String icon) void set_icon(String icon)
FUNC_API_SINCE(3); FUNC_API_SINCE(3);
void set_cursor(void)
FUNC_API_SINCE(3);
void reset_cursor(void)
FUNC_API_SINCE(3);
void screenshot(String path) void screenshot(String path)
FUNC_API_SINCE(7); FUNC_API_SINCE(7);
void option_set(String name, Object value) void option_set(String name, Object value)

View File

@ -1739,6 +1739,7 @@ void enter_buffer(buf_T *buf)
curwin->w_topfill = 0; curwin->w_topfill = 0;
apply_autocmds(EVENT_BUFENTER, NULL, NULL, false, curbuf); apply_autocmds(EVENT_BUFENTER, NULL, NULL, false, curbuf);
apply_autocmds(EVENT_BUFWINENTER, NULL, NULL, false, curbuf); apply_autocmds(EVENT_BUFWINENTER, NULL, NULL, false, curbuf);
ui_call_set_cursor();
} }
// If autocommands did not change the cursor position, restore cursor lnum // If autocommands did not change the cursor position, restore cursor lnum

View File

@ -29,7 +29,7 @@ typedef enum {
typedef enum { typedef enum {
SHAPE_BLOCK = 0, ///< block cursor SHAPE_BLOCK = 0, ///< block cursor
SHAPE_HOR = 1, ///< horizontal bar cursor SHAPE_HOR = 1, ///< horizontal bar cursor
SHAPE_VER = 2, ///< vertical bar cursor SHAPE_VER = 2, ///< vertical bar cursor
} CursorShape; } CursorShape;
#define MSHAPE_NUMBERED 1000 // offset for shapes identified by number #define MSHAPE_NUMBERED 1000 // offset for shapes identified by number

View File

@ -839,6 +839,7 @@ void setcursor_mayforce(win_T *wp, bool force)
grid_adjust(&grid, &row, &col); grid_adjust(&grid, &row, &col);
ui_grid_cursor_goto(grid->handle, row, col); ui_grid_cursor_goto(grid->handle, row, col);
ui_call_reset_cursor();
} }
} }

View File

@ -1239,6 +1239,17 @@ void tui_mode_info_set(TUIData *tui, bool guicursor_enabled, Array args)
tui_set_mode(tui, tui->showing_mode); tui_set_mode(tui, tui->showing_mode);
} }
void tui_set_cursor(TUIData *tui)
{
tui_set_mode(tui, tui->showing_mode);
}
void tui_reset_cursor(TUIData *tui)
{
unibi_out_ext(tui, tui->unibi_ext.reset_cursor_color);
unibi_out_ext(tui, tui->unibi_ext.reset_cursor_style);
}
void tui_update_menu(TUIData *tui) void tui_update_menu(TUIData *tui)
{ {
// Do nothing; menus are for GUI only // Do nothing; menus are for GUI only