9 Commits

Author SHA1 Message Date
p 9ff110a44e Bump version, update NEWS
Arch Linux AUR Success
OpenBSD 7.8 Success
Alpine 3.24 Success
2026-09-05 17:14:56 +02:00
p 0f30000109 Bump liberty
Alpine 3.24 Success
Arch Linux AUR Success
OpenBSD 7.8 Success
2026-09-05 16:53:57 +02:00
p faf82acc15 Bump version, update NEWS
Alpine 3.24 Success
Arch Linux AUR Success
OpenBSD 7.8 Success
2026-09-04 15:07:37 +02:00
p fc275b0860 Bump liberty 2026-09-04 15:02:04 +02:00
p 2295cab3a4 Bump liberty
Alpine 3.24 Success
Arch Linux AUR Success
OpenBSD 7.8 Success
2026-08-31 12:14:27 +02:00
p bda11fe9f0 Bump liberty
Alpine 3.24 Success
Arch Linux AUR Success
OpenBSD 7.8 Success
Not integrating the clipboard right now because unimportant.
2026-08-11 11:03:40 +02:00
p 7f6d6b24e5 Add an editor action to transpose characters
Alpine 3.24 Success
Arch Linux AUR Success
OpenBSD 7.8 Success
Bump liberty.
2026-08-10 13:33:59 +02:00
p 8b2b8bc08f Bump liberty
Alpine 3.24 Success
Arch Linux AUR Success
OpenBSD 7.8 Success
Fixes a regression and an old focusing bug.
2026-08-10 10:09:22 +02:00
p b98dffdf46 Bump liberty
Alpine 3.24 Success
Arch Linux AUR Success
OpenBSD 7.8 Success
2026-08-10 05:37:54 +02:00
5 changed files with 58 additions and 39 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
cmake_minimum_required (VERSION 3.0...3.27)
project (nncmpp VERSION 2.3.0 LANGUAGES C)
project (nncmpp VERSION 2.3.2 LANGUAGES C)
# Moar warnings
if ("${CMAKE_C_COMPILER_ID}" MATCHES "GNU" OR CMAKE_COMPILER_IS_GNUCC)
+12
View File
@@ -1,3 +1,15 @@
2.3.2 (2026-09-05)
* X11: fixed doubled Fontconfig substitutions
2.3.1 (2026-09-04)
* Added a Readline-like C-t editor binding
* X11: improved focus handling, improved IME integration
2.3.0 (2026-08-08)
* The "elapsed" attribute is now used for "remaining" as well.
+1 -1
Submodule liberty updated: fb6170f2b6...eba8ead2b7
+1
View File
@@ -68,6 +68,7 @@ EDITOR_F_WORD, Go forward a word
EDITOR_HOME, Go to start of line
EDITOR_END, Go to end of line
EDITOR_TRANSPOSE_CHARS, Transpose characters
EDITOR_UPCASE_WORD, Convert word to uppercase
EDITOR_DOWNCASE_WORD, Convert word to lowercase
EDITOR_CAPITALIZE_WORD, Capitalize word
+43 -37
View File
@@ -2321,8 +2321,6 @@ app_layout (void)
g_xui.widgets = widgets.head;
app_fix_view_range();
curs_set (0);
}
// --- Actions -----------------------------------------------------------------
@@ -2409,6 +2407,16 @@ app_on_clipboard_copy (const char *text)
app_show_message (xstrdup ("Text copied to clipboard: "), xstrdup (text));
}
static void
app_on_clipboard_paste (const char *text)
{
struct utf8_iter iter = utf8_iter_make (text);
int32_t codepoint = 0;
while ((codepoint = utf8_iter_next (&iter, NULL)) >= 0)
line_editor_insert (&g.editor, codepoint);
xui_invalidate ();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// On a 20x20 raster to make it feasible to design on paper.
@@ -2947,6 +2955,30 @@ app_process_action (enum action action)
}
}
static enum line_editor_action
app_map_editor_action (enum action action)
{
switch (action)
{
case ACTION_EDITOR_B_CHAR: return LINE_EDITOR_B_CHAR;
case ACTION_EDITOR_F_CHAR: return LINE_EDITOR_F_CHAR;
case ACTION_EDITOR_B_WORD: return LINE_EDITOR_B_WORD;
case ACTION_EDITOR_F_WORD: return LINE_EDITOR_F_WORD;
case ACTION_EDITOR_HOME: return LINE_EDITOR_HOME;
case ACTION_EDITOR_END: return LINE_EDITOR_END;
case ACTION_EDITOR_TRANSPOSE_CHARS: return LINE_EDITOR_TRANSPOSE_CHARS;
case ACTION_EDITOR_UPCASE_WORD: return LINE_EDITOR_UPCASE_WORD;
case ACTION_EDITOR_DOWNCASE_WORD: return LINE_EDITOR_DOWNCASE_WORD;
case ACTION_EDITOR_CAPITALIZE_WORD: return LINE_EDITOR_CAPITALIZE_WORD;
case ACTION_EDITOR_B_DELETE: return LINE_EDITOR_B_DELETE;
case ACTION_EDITOR_F_DELETE: return LINE_EDITOR_F_DELETE;
case ACTION_EDITOR_B_KILL_WORD: return LINE_EDITOR_B_KILL_WORD;
case ACTION_EDITOR_B_KILL_LINE: return LINE_EDITOR_B_KILL_LINE;
case ACTION_EDITOR_F_KILL_LINE: return LINE_EDITOR_F_KILL_LINE;
default: return -1;
}
}
static bool
app_editor_process_action (enum action action)
{
@@ -2962,39 +2994,13 @@ app_editor_process_action (enum action action)
g.editor.on_end = NULL;
return true;
default:
{
enum line_editor_action a = app_map_editor_action (action);
if (a != (enum line_editor_action) -1)
return line_editor_action (&g.editor, a);
print_error ("\"%s\" is not allowed here", action_description (action));
return false;
case ACTION_EDITOR_B_CHAR:
return line_editor_action (&g.editor, LINE_EDITOR_B_CHAR);
case ACTION_EDITOR_F_CHAR:
return line_editor_action (&g.editor, LINE_EDITOR_F_CHAR);
case ACTION_EDITOR_B_WORD:
return line_editor_action (&g.editor, LINE_EDITOR_B_WORD);
case ACTION_EDITOR_F_WORD:
return line_editor_action (&g.editor, LINE_EDITOR_F_WORD);
case ACTION_EDITOR_HOME:
return line_editor_action (&g.editor, LINE_EDITOR_HOME);
case ACTION_EDITOR_END:
return line_editor_action (&g.editor, LINE_EDITOR_END);
case ACTION_EDITOR_UPCASE_WORD:
return line_editor_action (&g.editor, LINE_EDITOR_UPCASE_WORD);
case ACTION_EDITOR_DOWNCASE_WORD:
return line_editor_action (&g.editor, LINE_EDITOR_DOWNCASE_WORD);
case ACTION_EDITOR_CAPITALIZE_WORD:
return line_editor_action (&g.editor, LINE_EDITOR_CAPITALIZE_WORD);
case ACTION_EDITOR_B_DELETE:
return line_editor_action (&g.editor, LINE_EDITOR_B_DELETE);
case ACTION_EDITOR_F_DELETE:
return line_editor_action (&g.editor, LINE_EDITOR_F_DELETE);
case ACTION_EDITOR_B_KILL_WORD:
return line_editor_action (&g.editor, LINE_EDITOR_B_KILL_WORD);
case ACTION_EDITOR_B_KILL_LINE:
return line_editor_action (&g.editor, LINE_EDITOR_B_KILL_LINE);
case ACTION_EDITOR_F_KILL_LINE:
return line_editor_action (&g.editor, LINE_EDITOR_F_KILL_LINE);
}
}
}
@@ -3262,6 +3268,7 @@ g_editor_defaults[] =
{ "C-a", ACTION_EDITOR_HOME },
{ "C-e", ACTION_EDITOR_END },
{ "C-t", ACTION_EDITOR_TRANSPOSE_CHARS },
{ "M-u", ACTION_EDITOR_UPCASE_WORD },
{ "M-l", ACTION_EDITOR_DOWNCASE_WORD },
{ "M-c", ACTION_EDITOR_CAPITALIZE_WORD },
@@ -5842,10 +5849,7 @@ tui_render_editor (struct widget *self)
for (; start < e->len; start++)
row_buffer_append_c (&buf, e->line[start], self->attrs);
tui_flush_buffer (self, 0, &buf);
// FIXME: This should be at the end of of tui_render().
move (self->y, self->x + preceding);
curs_set (1);
tui_set_cursor (self->x + preceding, self->y);
}
static struct widget *
@@ -5968,6 +5972,8 @@ x11_render_editor (struct widget *self)
XRenderColor white = { 0xffff, 0xffff, 0xffff, 0xffff };
XRenderFillRectangle (g_xui.dpy, PictOpDifference, g_xui.x11_pixmap_picture,
&white, caret, self->y, CARET_WIDTH, self->height);
x11_set_cursor (caret,
self->y + x11_widget_font (self)->list->font->ascent);
}
static struct widget *