Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce /redraw command #1931

Merged
merged 1 commit into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/command/cmd_defs.c
Original file line number Diff line number Diff line change
Expand Up @@ -2729,6 +2729,18 @@ static const struct cmd_t command_defs[] = {
"/privacy logging off",
"/privacy os off")
},

{ CMD_PREAMBLE("/redraw",
parse_args, 0, 0, NULL)
CMD_MAINFUNC(cmd_redraw)
CMD_TAGS(
CMD_TAG_UI)
CMD_SYN(
"/redraw")
CMD_DESC(
"Redraw user interface. Can be used when some other program interrupted profanity or wrote to the same terminal and the interface looks \"broken\"." )
},

// NEXT-COMMAND (search helper)
};

Expand Down
8 changes: 8 additions & 0 deletions src/command/cmd_funcs.c
Original file line number Diff line number Diff line change
Expand Up @@ -9727,6 +9727,14 @@ cmd_correct_editor(ProfWin* window, const char* const command, gchar** args)
return TRUE;
}

gboolean
cmd_redraw(ProfWin* window, const char* const command, gchar** args)
{
ui_resize();

return TRUE;
}

gboolean
cmd_silence(ProfWin* window, const char* const command, gchar** args)
{
Expand Down
1 change: 1 addition & 0 deletions src/command/cmd_funcs.h
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ gboolean cmd_executable_vcard_photo(ProfWin* window, const char* const command,
gboolean cmd_mam(ProfWin* window, const char* const command, gchar** args);
gboolean cmd_editor(ProfWin* window, const char* const command, gchar** args);
gboolean cmd_correct_editor(ProfWin* window, const char* const command, gchar** args);
gboolean cmd_redraw(ProfWin* window, const char* const command, gchar** args);
gboolean cmd_silence(ProfWin* window, const char* const command, gchar** args);
gboolean cmd_register(ProfWin* window, const char* const command, gchar** args);
gboolean cmd_mood(ProfWin* window, const char* const command, gchar** args);
Expand Down