From c3c791be55ea32f35228852d8d90442419a8ed5c Mon Sep 17 00:00:00 2001 From: baldurk Date: Thu, 11 Aug 2022 10:23:48 +0100 Subject: [PATCH] When editing a shader, default to the edit base file * In the case of a munged file with #line directives, we want to edit that file, not the split-out view of the file containing the entry point. --- qrenderdoc/Windows/ShaderViewer.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/qrenderdoc/Windows/ShaderViewer.cpp b/qrenderdoc/Windows/ShaderViewer.cpp index f96e452bd..9170ae1dd 100644 --- a/qrenderdoc/Windows/ShaderViewer.cpp +++ b/qrenderdoc/Windows/ShaderViewer.cpp @@ -329,11 +329,12 @@ void ShaderViewer::editShader(ResourceId id, ShaderStage stage, const QString &e w->setProperty("filename", kv.first); w->setProperty("origText", kv.second); - if(text.contains(entryPoint)) + if(sel == NULL) + { sel = scintilla; - if(sel == scintilla || title.isEmpty()) title = tr(" - %1 - %2()").arg(name).arg(entryPoint); + } } if(sel != NULL)