From 50d3132e7b95e9fcbdb24856be21fb585d4eaf74 Mon Sep 17 00:00:00 2001 From: Chris Grieser <73286100+chrisgrieser@users.noreply.github.com> Date: Wed, 5 Jun 2024 19:14:41 +0200 Subject: [PATCH] fix(incrementalPreview): highlight error when no matches --- lua/rip-substitute/rg-operations.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/rip-substitute/rg-operations.lua b/lua/rip-substitute/rg-operations.lua index 7ff6965..8241c99 100644 --- a/lua/rip-substitute/rg-operations.lua +++ b/lua/rip-substitute/rg-operations.lua @@ -68,7 +68,7 @@ end ---@return Iter { lnum: number, col: number, text: string } local function rgResultsIter(rgArgs) local rgResult = runRipgrep(rgArgs) - if rgResult.code ~= 0 then return {} end + if rgResult.code ~= 0 then return vim.iiter({}) end -- empty iter on error local rgLines = vim.split(vim.trim(rgResult.stdout), "\n") local state = require("rip-substitute.state").state