xC/xF: make it possible to insert newlines directly
Alpine 3.24 Success
Arch Linux AUR Success
OpenBSD 7.8 Success

That should do for us to stop claiming that the interface needs polish.
This commit is contained in:
2026-08-10 08:09:14 +02:00
parent 63d54df66a
commit a1c7d2c983
3 changed files with 17 additions and 3 deletions
+1 -3
View File
@@ -11,9 +11,7 @@ They're all lean on dependencies, and offer a maximally permissive licence.
xC
--
The IRC client, and the core of 'xK'. Its interface should feel somewhat
familiar for WeeChat or irssi users. Currently the terminal interface
experience deserves some polishing, because we've just got rid of
Readline/Editline dependencies, which kept breaking in exciting ways.
familiar for WeeChat or irssi users.
image::xC.webp[align="center"]
+11
View File
@@ -14442,6 +14442,15 @@ on_insert_attribute (int key, void *user_data)
return true;
}
static bool
on_insert_newline (int key, void *user_data)
{
(void) key;
struct app_context *ctx = user_data;
return input_insert (ctx->input, "\n");
}
#define BRACKETED_PASTE_LIMIT 102400 ///< How much text can be pasted
static bool
@@ -14636,6 +14645,7 @@ app_input_init (struct input *self)
XX ("edit-input", "Edit input", on_edit_input)
XX ("redraw-screen", "Redraw screen", on_redraw_screen)
XX ("insert-attribute", "IRC formatting", on_insert_attribute)
XX ("insert-newline", "Insert newline", on_insert_newline)
XX ("start-paste-mode", "Bracketed paste", on_start_paste_mode)
XX ("accept-line", "Send line", on_input_return)
XX ("complete", "Complete word", on_input_complete)
@@ -14656,6 +14666,7 @@ app_input_init (struct input *self)
input_bind (self, "M-a", "goto-activity");
input_bind (self, "M-A", "goto-backtivity");
input_bind (self, "M-m", "insert-attribute");
input_bind (self, "M-Enter", "insert-newline");
input_bind (self, "M-h", "display-full-log");
input_bind (self, "M-H", "toggle-unimportant");
input_bind (self, "M-e", "edit-input");
+5
View File
@@ -278,6 +278,7 @@ enum action
ACTION_EDIT_INPUT,
ACTION_VIEW_TRANSCRIPT,
ACTION_OPEN,
ACTION_INSERT_NEWLINE,
ACTION_FORMAT,
ACTION_FORMAT_BOLD,
ACTION_FORMAT_ITALIC,
@@ -3980,6 +3981,9 @@ app_process_action (enum action action)
return app_launch_transcript_editor ();
case ACTION_OPEN:
return app_open_last_link ();
case ACTION_INSERT_NEWLINE:
app_editor_insert ('\n');
return true;
case ACTION_FORMAT:
g.inserting_attribute = true;
return true;
@@ -4155,6 +4159,7 @@ g_default_bindings[] =
{ "M-e", ACTION_EDIT_INPUT }, // xC
{ "M-E", ACTION_VIEW_TRANSCRIPT }, // xF
{ "C-o", ACTION_OPEN }, // xF
{ "M-Enter", ACTION_INSERT_NEWLINE },
{ "M-m", ACTION_FORMAT }, // xC
{ "PageUp", ACTION_SCROLL_UP },
{ "PageDown", ACTION_SCROLL_DOWN },