improv: removing tabs (#2345)

These changes are part of an effort aimed at removing tabs from ImHex
that started some time ago. Here text preprocessing is removed from all
the places were it was done before and moved to the places where files
are read that go in the pattern editor with two notable exceptions.
1) Pattern import reads patterns in order to present a list that can be
filtered.That can safely ignore preprocessing since only needs to get
information needed to filter.
2) The pattern editor can incorporate text from the clipboard so that
needs to be preprocessed as well.

find/replace is unable to add tabs or carriage returns so this should
cover all angles.
This commit is contained in:
paxcut
2025-07-20 13:10:45 -07:00
committed by GitHub
parent cc6590d780
commit 5df8ec78aa
4 changed files with 16 additions and 20 deletions

View File

@@ -1958,7 +1958,7 @@ namespace hex::plugin::builtin {
m_lines.clear();
if (m_text.empty())
m_text = m_viewPatternEditor->getTextEditor().PreprocessText(m_viewPatternEditor->getTextEditor().GetText());
m_text = m_viewPatternEditor->getTextEditor().GetText();
m_lines = hex::splitString(m_text, "\n");
m_lines.push_back("");
@@ -2252,7 +2252,7 @@ namespace hex::plugin::builtin {
auto lastToken = m_tokens.back();
m_tokens.push_back(lastToken);
m_text = m_viewPatternEditor->getTextEditor().PreprocessText( m_viewPatternEditor->getTextEditor().GetText());
m_text = m_viewPatternEditor->getTextEditor().GetText();
if (m_text.empty() || m_text == "\n")
return;