ITADN

Fix regex search

#52Pull Requestilyakorovin 创建于 2025-08-03
I
ilyakorovincommented
Regex-based search has been broken since commit 429e2db. While file searching and preview still work correctly, attempting to perform a replace operation silently fails—despite a success message being shown. The issue lies in the **get_search_regex** function, which escapes the regex pattern in the same way it does for simple (non-regex) searches. However, simply fixing **get_search_regex** also breaks the preview: the file content is shown without any diffs. This happens because the diff is calculated using **get_search_regex**, with **SearchTextKind** from the state and the matched substring used as the pattern. Instead, when generating the diff, we should use the matched substring directly as the regex pattern—without passing it through **get_search_regex**.
合并状态:未合并 0 条评论