linux-qubasis
linux oasis port as a qubes template
git clone https://9o.is/git/linux-qubasis.git
commit 97e5d1211b5c22f38bafc9d74c85e2026fc4dc67 parent a48b8fb7eb5c02a501c32fd64e00f83b1e18e569 Author: Jul <jul@9o.is> Date: Tue, 14 Oct 2025 12:05:18 +0800 remove unused vis patches Diffstat:
| D | pkg/vis/patch/0002-add-vis-command_unregister-allow-unregistering-built.patch | | | 77 | ----------------------------------------------------------------------------- |
| A | pkg/vis/patch/0002-bug-fix-hide-vis-cursor-on-prev-next-win.patch | | | 39 | +++++++++++++++++++++++++++++++++++++++ |
| D | pkg/vis/patch/0003-add-WIN_FOCUS-event.patch | | | 119 | ------------------------------------------------------------------------------- |
| A | pkg/vis/patch/0003-only-reload-ncurses-if-piped-fullscreen.patch | | | 36 | ++++++++++++++++++++++++++++++++++++ |
| D | pkg/vis/patch/0004-bug-fix-hide-vis-cursor-on-prev-next-win.patch | | | 39 | --------------------------------------- |
| D | pkg/vis/patch/0005-only-reload-ncurses-if-piped-fullscreen.patch | | | 36 | ------------------------------------ |
6 files changed, 75 insertions(+), 271 deletions(-)
diff --git a/pkg/vis/patch/0002-add-vis-command_unregister-allow-unregistering-built.patch b/pkg/vis/patch/0002-add-vis-command_unregister-allow-unregistering-built.patch @@ -1,77 +0,0 @@ -From cb2d881ae199684a6bf6d97a3f34c66168ea43f6 Mon Sep 17 00:00:00 2001 -From: Jul <jul@qh.is> -Date: Sat, 11 Oct 2025 22:39:18 +0800 -Subject: [PATCH] add vis:command_unregister() - allow unregistering builtin - commands - ---- - vis-cmds.c | 25 ++++++++++++++++--------- - vis-lua.c | 9 +++++++++ - 2 files changed, 25 insertions(+), 9 deletions(-) - -diff --git a/vis-cmds.c b/vis-cmds.c -index 892f5a5..ed9be52 100644 ---- a/vis-cmds.c -+++ b/vis-cmds.c -@@ -51,15 +51,22 @@ err: - bool vis_cmd_unregister(Vis *vis, const char *name) { - if (!name) - return true; -- CmdUser *cmd = map_get(vis->usercmds, name); -- if (!cmd) -- return false; -- if (!map_delete(vis->cmds, name)) -- return false; -- if (!map_delete(vis->usercmds, name)) -- return false; -- cmdfree(cmd); -- return true; -+ CmdUser *cmduser = map_get(vis->usercmds, name); -+ if (cmduser) { -+ if (!map_delete(vis->cmds, name)) -+ return false; -+ if (!map_delete(vis->usercmds, name)) -+ return false; -+ cmdfree(cmduser); -+ return true; -+ } -+ CommandDef *cmddef = map_get(vis->cmds, name); -+ if (cmddef) { -+ if (!map_delete(vis->cmds, name)) -+ return false; -+ return true; -+ } -+ return false; - } - - static void option_free(OptionDef *opt) { -diff --git a/vis-lua.c b/vis-lua.c -index f7e9001..3c233fa 100644 ---- a/vis-lua.c -+++ b/vis-lua.c -@@ -1146,6 +1146,14 @@ static int command_register(lua_State *L) { - return 1; - } - -+static int command_unregister(lua_State *L) { -+ Vis *vis = obj_ref_check(L, 1, "vis"); -+ const char *name = luaL_checkstring(L, 2); -+ bool ret = vis_cmd_unregister(vis, name); -+ lua_pushboolean(L, ret); -+ return 1; -+} -+ - /*** - * Push keys to input queue and interpret them. - * -@@ -1559,6 +1567,7 @@ static const struct luaL_Reg vis_lua[] = { - { "option_register", option_register }, - { "option_unregister", option_unregister }, - { "command_register", command_register }, -+ { "command_unregister", command_unregister }, - { "feedkeys", feedkeys }, - { "insert", insert }, - { "replace", replace }, --- -2.51.0 - diff --git a/pkg/vis/patch/0002-bug-fix-hide-vis-cursor-on-prev-next-win.patch b/pkg/vis/patch/0002-bug-fix-hide-vis-cursor-on-prev-next-win.patch @@ -0,0 +1,39 @@ +From 9a2bcb5dc58cefef9213ad41a32829dc01c219d2 Mon Sep 17 00:00:00 2001 +From: Jul <jul@qh.is> +Date: Mon, 13 Oct 2025 01:55:46 +0800 +Subject: [PATCH] bug fix: hide vis cursor on prev/next win + +--- + vis.c | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +diff --git a/vis.c b/vis.c +index 08ee6b2..23ac26c 100644 +--- a/vis.c ++++ b/vis.c +@@ -461,16 +461,18 @@ void vis_window_next(Vis *vis) { + if (!sel) + return; + vis_window_focus(sel->next ? sel->next : vis->windows); ++ vis_window_invalidate(sel); + } + + void vis_window_prev(Vis *vis) { + Win *sel = vis->win; + if (!sel) + return; +- sel = sel->prev; +- if (!sel) +- for (sel = vis->windows; sel->next; sel = sel->next); +- vis_window_focus(sel); ++ Win *prev = sel->prev; ++ if (!prev) ++ for (prev = vis->windows; prev->next; prev = prev->next); ++ vis_window_focus(prev); ++ vis_window_invalidate(sel); + } + + void vis_draw(Vis *vis) { +-- +2.51.0 + diff --git a/pkg/vis/patch/0003-add-WIN_FOCUS-event.patch b/pkg/vis/patch/0003-add-WIN_FOCUS-event.patch @@ -1,119 +0,0 @@ -From 04bcd4ae8d6838d27b02ad4286f3838c622e3888 Mon Sep 17 00:00:00 2001 -From: Jul <jul@qh.is> -Date: Sun, 12 Oct 2025 23:41:09 +0800 -Subject: [PATCH] add WIN_FOCUS event - ---- - lua/vis.lua | 2 ++ - vis-core.h | 1 + - vis-lua.c | 15 +++++++++++++++ - vis.c | 6 +++++- - 4 files changed, 23 insertions(+), 1 deletion(-) - -diff --git a/lua/vis.lua b/lua/vis.lua -index 9ac41b0..481801b 100644 ---- a/lua/vis.lua -+++ b/lua/vis.lua -@@ -166,6 +166,7 @@ local events = { - WIN_HIGHLIGHT = "Event::WIN_HIGHLIGHT", -- see @{win_highlight} - WIN_OPEN = "Event::WIN_OPEN", -- see @{win_open} - WIN_STATUS = "Event::WIN_STATUS", -- see @{win_status} -+ WIN_FOCUS = "Event::WIN_FOCUS", -- see @{win_focus} - TERM_CSI = "Event::TERM_CSI", -- see @{term_csi} - PROCESS_RESPONSE = "Event::PROCESS_RESPONSE", -- see @{process_response} - UI_DRAW = "Event::UI_DRAW", -- see @{ui_draw} -@@ -183,6 +184,7 @@ events.win_close = function(...) events.emit(events.WIN_CLOSE, ...) end - events.win_highlight = function(...) events.emit(events.WIN_HIGHLIGHT, ...) end - events.win_open = function(...) events.emit(events.WIN_OPEN, ...) end - events.win_status = function(...) events.emit(events.WIN_STATUS, ...) end -+events.win_focus = function(...) events.emit(events.WIN_FOCUS, ...) end - events.term_csi = function(...) events.emit(events.TERM_CSI, ...) end - events.process_response = function(...) events.emit(events.PROCESS_RESPONSE, ...) end - events.ui_draw = function(...) events.emit(events.UI_DRAW, ...) end -diff --git a/vis-core.h b/vis-core.h -index 92770ee..e8f14e8 100644 ---- a/vis-core.h -+++ b/vis-core.h -@@ -235,6 +235,7 @@ enum VisEvents { - VIS_EVENT_WIN_CLOSE, - VIS_EVENT_WIN_HIGHLIGHT, - VIS_EVENT_WIN_STATUS, -+ VIS_EVENT_WIN_FOCUS, - VIS_EVENT_TERM_CSI, - VIS_EVENT_UI_DRAW, - }; -diff --git a/vis-lua.c b/vis-lua.c -index 3c233fa..060058f 100644 ---- a/vis-lua.c -+++ b/vis-lua.c -@@ -3581,6 +3581,18 @@ static void vis_lua_win_status(Vis *vis, Win *win) { - lua_pop(L, 1); - } - -+static void vis_lua_win_focus(Vis *vis, Win *win) { -+ lua_State *L = vis->lua; -+ if (!L || win->file->internal) -+ return; -+ vis_lua_event_get(L, "win_focus"); -+ if (lua_isfunction(L, -1)) { -+ obj_ref_new(L, win, VIS_LUA_TYPE_WINDOW); -+ pcall(vis, L, 1, 0); -+ } -+ lua_pop(L, 1); -+} -+ - /*** - * CSI command received from terminal. - * @function term_csi -@@ -3687,6 +3699,7 @@ bool vis_event_emit(Vis *vis, enum VisEvents id, ...) { - case VIS_EVENT_WIN_CLOSE: - case VIS_EVENT_WIN_HIGHLIGHT: - case VIS_EVENT_WIN_STATUS: -+ case VIS_EVENT_WIN_FOCUS: - { - Win *win = va_arg(ap, Win*); - if (win->file->internal && id != VIS_EVENT_WIN_STATUS) -@@ -3699,6 +3712,8 @@ bool vis_event_emit(Vis *vis, enum VisEvents id, ...) { - vis_lua_win_highlight(vis, win); - } else if (id == VIS_EVENT_WIN_STATUS) { - vis_lua_win_status(vis, win); -+ } else if (id == VIS_EVENT_WIN_FOCUS) { -+ vis_lua_win_focus(vis, win); - } - break; - } -diff --git a/vis.c b/vis.c -index 08ee6b2..16ad8a0 100644 ---- a/vis.c -+++ b/vis.c -@@ -398,6 +398,7 @@ Win *window_new_file(Vis *vis, File *file, enum UiOption options) { - for (size_t i = 0; i < LENGTH(win->modes); i++) - win->modes[i].parent = &vis_modes[i]; - vis_event_emit(vis, VIS_EVENT_WIN_OPEN, win); -+ vis_event_emit(vis, VIS_EVENT_WIN_FOCUS, win); - return win; - } - -@@ -454,6 +455,7 @@ void vis_window_focus(Win *win) { - Vis *vis = win->vis; - vis->win = win; - ui_window_focus(win); -+ vis_event_emit(vis, VIS_EVENT_WIN_FOCUS, win); - } - - void vis_window_next(Vis *vis) { -@@ -559,8 +561,10 @@ void vis_window_close(Win *win) { - if (win == vis->message_window) - vis->message_window = NULL; - window_free(win); -- if (vis->win) -+ if (vis->win) { - ui_window_focus(vis->win); -+ vis_event_emit(vis, VIS_EVENT_WIN_FOCUS, vis->win); -+ } - vis_draw(vis); - } - --- -2.51.0 - diff --git a/pkg/vis/patch/0003-only-reload-ncurses-if-piped-fullscreen.patch b/pkg/vis/patch/0003-only-reload-ncurses-if-piped-fullscreen.patch @@ -0,0 +1,36 @@ +From f74f260fd81be92284448a077d42d7a1afc6a2ff Mon Sep 17 00:00:00 2001 +From: Jul <jul@qh.is> +Date: Tue, 14 Oct 2025 12:01:45 +0800 +Subject: [PATCH] only reload ncurses if piped fullscreen + +--- + vis.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/vis.c b/vis.c +index 23ac26c..39e7afa 100644 +--- a/vis.c ++++ b/vis.c +@@ -1623,7 +1623,8 @@ static int _vis_pipe(Vis *vis, File *file, Filerange *range, const char* buf, co + return -1; + } + +- ui_terminal_save(&vis->ui, fullscreen); ++ if (fullscreen) ++ ui_terminal_save(&vis->ui, fullscreen); + pid_t pid = fork(); + + if (pid == -1) { +@@ -1833,7 +1834,8 @@ err: + sigaction(SIGTERM, &sigterm_old, NULL); + + vis->interrupted = false; +- ui_terminal_restore(&vis->ui); ++ if (fullscreen) ++ ui_terminal_restore(&vis->ui); + + if (WIFEXITED(status)) + return WEXITSTATUS(status); +-- +2.51.0 + diff --git a/pkg/vis/patch/0004-bug-fix-hide-vis-cursor-on-prev-next-win.patch b/pkg/vis/patch/0004-bug-fix-hide-vis-cursor-on-prev-next-win.patch @@ -1,39 +0,0 @@ -From b7084670702ac31c05ed8879211288c14cde3cba Mon Sep 17 00:00:00 2001 -From: Jul <jul@qh.is> -Date: Mon, 13 Oct 2025 01:55:46 +0800 -Subject: [PATCH] bug fix: hide vis cursor on prev/next win - ---- - vis.c | 10 ++++++---- - 1 file changed, 6 insertions(+), 4 deletions(-) - -diff --git a/vis.c b/vis.c -index 16ad8a0..0c59d57 100644 ---- a/vis.c -+++ b/vis.c -@@ -463,16 +463,18 @@ void vis_window_next(Vis *vis) { - if (!sel) - return; - vis_window_focus(sel->next ? sel->next : vis->windows); -+ vis_window_invalidate(sel); - } - - void vis_window_prev(Vis *vis) { - Win *sel = vis->win; - if (!sel) - return; -- sel = sel->prev; -- if (!sel) -- for (sel = vis->windows; sel->next; sel = sel->next); -- vis_window_focus(sel); -+ Win *prev = sel->prev; -+ if (!prev) -+ for (prev = vis->windows; prev->next; prev = prev->next); -+ vis_window_focus(prev); -+ vis_window_invalidate(sel); - } - - void vis_draw(Vis *vis) { --- -2.51.0 - diff --git a/pkg/vis/patch/0005-only-reload-ncurses-if-piped-fullscreen.patch b/pkg/vis/patch/0005-only-reload-ncurses-if-piped-fullscreen.patch @@ -1,36 +0,0 @@ -From aefbabd6542ca6918b95c707f44928f69f6c827d Mon Sep 17 00:00:00 2001 -From: Jul <jul@qh.is> -Date: Tue, 14 Oct 2025 12:01:45 +0800 -Subject: [PATCH] only reload ncurses if piped fullscreen - ---- - vis.c | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/vis.c b/vis.c -index 0c59d57..85d6e30 100644 ---- a/vis.c -+++ b/vis.c -@@ -1627,7 +1627,8 @@ static int _vis_pipe(Vis *vis, File *file, Filerange *range, const char* buf, co - return -1; - } - -- ui_terminal_save(&vis->ui, fullscreen); -+ if (fullscreen) -+ ui_terminal_save(&vis->ui, fullscreen); - pid_t pid = fork(); - - if (pid == -1) { -@@ -1837,7 +1838,8 @@ err: - sigaction(SIGTERM, &sigterm_old, NULL); - - vis->interrupted = false; -- ui_terminal_restore(&vis->ui); -+ if (fullscreen) -+ ui_terminal_restore(&vis->ui); - - if (WIFEXITED(status)) - return WEXITSTATUS(status); --- -2.51.0 -