From af53f662ce664578cfa771ae10a6577af6a6944e Mon Sep 17 00:00:00 2001 From: sharpchen Date: Thu, 12 Mar 2026 20:30:27 +0800 Subject: [PATCH] fix(csharp): guard on no quote --- lua/template-string/langs/csharp.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lua/template-string/langs/csharp.lua b/lua/template-string/langs/csharp.lua index 8cef742..ba2f8aa 100644 --- a/lua/template-string/langs/csharp.lua +++ b/lua/template-string/langs/csharp.lua @@ -77,7 +77,13 @@ end function M.before_quotes(node, text) local node_row, node_col = node:range() local cursor_row, cursor_col = unpack(vim.api.nvim_win_get_cursor(0)) - local first_quote_col = text:find('"') + node_col + local quote_idx = text:find('"') + + if not quote_idx then + return false + end + + local first_quote_col = quote_idx + node_col cursor_row = cursor_row - 1