Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
9ff110a44e
|
|||
|
0f30000109
|
|||
|
faf82acc15
|
|||
|
fc275b0860
|
|||
|
2295cab3a4
|
|||
|
bda11fe9f0
|
|||
|
7f6d6b24e5
|
|||
|
8b2b8bc08f
|
|||
|
b98dffdf46
|
+1
-1
@@ -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)
|
||||
|
||||
@@ -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
@@ -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
|
||||
|
||||
@@ -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 *
|
||||
|
||||
Reference in New Issue
Block a user