Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
sdottaka committed Jan 1, 2025
1 parent b9df86d commit 0593ea5
Show file tree
Hide file tree
Showing 56 changed files with 1,245 additions and 219 deletions.
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

0 comments on commit 0593ea5

Please sign in to comment.