Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable per-file plugin application with file number specification #2598

Merged
merged 9 commits into from
Jan 5, 2025
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Src/DiffFileData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ void DiffFileData::Reset()
* return false if anything fails
* caller has to DeleteFile filepathTransformed, if it differs from filepath
*/
bool DiffFileData::Filepath_Transform(bool bForceUTF8,
const FileTextEncoding & encoding, const String & filepath, String & filepathTransformed,
bool DiffFileData::Filepath_Transform(int target, bool bForceUTF8,
const FileTextEncoding& encoding, const String& filepath, String& filepathTransformed,
const String& filteredFilenames, PrediffingInfo& infoPrediffer)
{
// third step : prediff (plugins)
Expand All @@ -138,7 +138,7 @@ bool DiffFileData::Filepath_Transform(bool bForceUTF8,
// if a prediffer fails, we consider it is not the good one, that's all
// FileTransform_Prediffing returns `false` only if the prediffer works,
// but the data can not be saved to disk (no more place ??)
if (!infoPrediffer.Prediffing(filepathTransformed, filteredFilenames, bMayOverwrite, { filepath }))
if (!infoPrediffer.Prediffing(target, filepathTransformed, filteredFilenames, bMayOverwrite, { filepath }))
return false;

if ((encoding.m_unicoding && encoding.m_unicoding != ucr::UTF8) || bForceUTF8)
Expand Down
2 changes: 1 addition & 1 deletion Src/DiffFileData.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ struct DiffFileData
void Close() { Reset(); }
void SetDisplayFilepaths(const String& szTrueFilepath1, const String& szTrueFilepath2);

bool Filepath_Transform(bool bForceUTF8, const FileTextEncoding & encoding, const String & filepath, String & filepathTransformed,
bool Filepath_Transform(int target, bool bForceUTF8, const FileTextEncoding & encoding, const String & filepath, String & filepathTransformed,
const String& filteredFilenames, PrediffingInfo& infoPrediffer);

// Data (public)
Expand Down
4 changes: 2 additions & 2 deletions Src/DiffTextBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ int CDiffTextBuffer::LoadFromFile(const tchar_t* pszFileNameInit,

// Unpacking the file here, save the result in a temporary file
m_strTempFileName = pszFileNameInit;
if (!infoUnpacker.Unpacking(&m_unpackerSubcodes, m_strTempFileName, sToFindUnpacker, { m_strTempFileName }))
if (!infoUnpacker.Unpacking(m_nThisPane, &m_unpackerSubcodes, m_strTempFileName, sToFindUnpacker, { m_strTempFileName }))
{
InitNew(); // leave crystal editor in valid, empty state
return FileLoadResult::FRESULT_ERROR_UNPACK;
Expand Down Expand Up @@ -516,7 +516,7 @@ int CDiffTextBuffer::SaveToFile (const String& pszFileName,
// If we are saving user files
// we need an unpacker/packer, at least a "do nothing" one
// repack the file here, overwrite the temporary file we did save in
bSaveSuccess = infoUnpacker.Packing(sIntermediateFilename, pszFileName, m_unpackerSubcodes, { pszFileName });
bSaveSuccess = infoUnpacker.Packing(m_nThisPane, sIntermediateFilename, pszFileName, m_unpackerSubcodes, { pszFileName });
if (!bSaveSuccess)
sError = GetSysError();
try
Expand Down
2 changes: 1 addition & 1 deletion Src/DiffWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,7 @@ bool CDiffWrapper::RunFileDiff()

// this can only fail if the data can not be saved back (no more
// place on disk ???) What to do then ??
if (m_infoPrediffer && !m_infoPrediffer->Prediffing(strFileTemp[file], m_sToFindPrediffer, m_bPathsAreTemp, { strFileTemp[file] }))
if (m_infoPrediffer && !m_infoPrediffer->Prediffing(file, strFileTemp[file], m_sToFindPrediffer, m_bPathsAreTemp, { strFileTemp[file] }))
{
// display a message box
String sError = strutils::format_string2(
Expand Down
Loading
Loading