GP-473 Pass breakOnWhiteSpace param thru to wrap function. Don't let decompiler layout add extra line breaks based on white space. Adjust prettyprint overflow in the middle of comments

This commit is contained in:
ghidra1 2021-01-29 10:30:00 -05:00
parent b5c7e7104c
commit 7c5e0e868b
4 changed files with 91 additions and 35 deletions

View file

@ -595,11 +595,21 @@ void EmitPrettyPrint::overflow(void)
else
break;
}
int4 newspaceremain;
if (!indentstack.empty())
spaceremain = indentstack.back();
newspaceremain = indentstack.back();
else
spaceremain = maxlinesize;
newspaceremain = maxlinesize;
if (newspaceremain == spaceremain)
return; // Line breaking doesn't give us any additional space
if (commentmode && (newspaceremain == spaceremain + commentfill.size()))
return; // Line breaking doesn't give us any additional space
spaceremain = newspaceremain;
lowlevel->tagLine(maxlinesize-spaceremain);
if (commentmode &&(commentfill.size() != 0)) {
lowlevel->print(commentfill.c_str(),EmitXml::comment_color);
spaceremain -= commentfill.size();
}
}
/// Content and markup is sent to the low-level emitter if appropriate. The