From 2443dbcb55424d8d79cc3fa0214769dfd1bf18fb Mon Sep 17 00:00:00 2001 From: Jake Turner Date: Fri, 8 Nov 2024 15:53:38 +0000 Subject: [PATCH] Shader Editing: Fix problem where single Replace didn't work Use the same findHash string in performReplace() as in performFind() by including the find direction in the findHash in performReplace() --- qrenderdoc/Windows/ShaderViewer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qrenderdoc/Windows/ShaderViewer.cpp b/qrenderdoc/Windows/ShaderViewer.cpp index 87f83849a..9bfe7a8b0 100644 --- a/qrenderdoc/Windows/ShaderViewer.cpp +++ b/qrenderdoc/Windows/ShaderViewer.cpp @@ -6533,7 +6533,8 @@ void ShaderViewer::performReplace() FindReplace::SearchContext context = m_FindReplace->context(); - QString findHash = QFormatStr("%1%2%3").arg(find).arg(flags).arg((int)context); + bool down = m_FindReplace->direction() == FindReplace::Down; + QString findHash = QFormatStr("%1%2%3%4").arg(find).arg(flags).arg((int)context).arg(down); // if we didn't have a valid previous find, just do a find and bail if(findHash != m_FindState.hash)