From 8a6e06f137dc5149485e80e41038b9d0b7d54e48 Mon Sep 17 00:00:00 2001 From: Shooter23 <44271378+Shooter23@users.noreply.github.com> Date: Thu, 12 Sep 2024 13:00:55 -0400 Subject: [PATCH] Surround word with "\\<" and "\\>" for search_current(). The crosshatch (#) and asterisk (*) commands in Vim perform exact word searches. For example, with the cursor on "word", the asterisk would perform "/\" to search for the next exact occurrence of "word". --- vimode/src/cmds/special.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vimode/src/cmds/special.c b/vimode/src/cmds/special.c index 7f15aba5f..34b17dccb 100644 --- a/vimode/src/cmds/special.c +++ b/vimode/src/cmds/special.c @@ -94,7 +94,7 @@ static void search_current(CmdContext *c, CmdParams *p, gboolean next) else { const gchar *prefix = next ? "/" : "?"; - c->search_text = g_strconcat(prefix, word, NULL); + c->search_text = g_strconcat(prefix, "\\<", word, "\\>", NULL); } g_free(word);