Fix custom shader edits to write the exact editor contents to disk

This commit is contained in:
baldurk
2021-05-17 13:47:58 +01:00
parent 4a9d32db3f
commit 331db5b4ba
4 changed files with 36 additions and 2 deletions
+16
View File
@@ -4086,6 +4086,22 @@ void ShaderViewer::AddWatch(const rdcstr &variable)
ui->watch->QWidget::setFocus();
}
rdcstrpairs ShaderViewer::GetCurrentFileContents()
{
rdcstrpairs files;
for(ScintillaEdit *s : m_Scintillas)
{
// don't include the disassembly view
if(m_DisassemblyView == s)
continue;
QWidget *w = (QWidget *)s;
files.push_back(
{w->property("filename").toString(), QString::fromUtf8(s->getText(s->textLength() + 1))});
}
return files;
}
int ShaderViewer::snippetPos()
{
ShaderEncoding encoding = currentEncoding();