From 46d0f12c3e687c83efbaa04f7ebd95616678226c Mon Sep 17 00:00:00 2001 From: SinghRajenM Date: Mon, 1 Jan 2018 22:54:27 +0530 Subject: [PATCH] Fix line ending changes are not detected in reloaded changed files issue Fixes #4033, closes #4043 --- PowerEditor/src/ScitillaComponent/Buffer.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/PowerEditor/src/ScitillaComponent/Buffer.cpp b/PowerEditor/src/ScitillaComponent/Buffer.cpp index 770ad3a9e..e78a2c7af 100644 --- a/PowerEditor/src/ScitillaComponent/Buffer.cpp +++ b/PowerEditor/src/ScitillaComponent/Buffer.cpp @@ -648,7 +648,7 @@ bool FileManager::reloadBuffer(BufferID id) buf->_canNotify = false; //disable notify during file load, we dont want dirty to be triggered int encoding = buf->getEncoding(); char data[blockSize + 8]; // +8 for incomplete multibyte char - EolType bkformat; + EolType bkformat = EolType::unknown; LangType lang = buf->getLangType(); @@ -669,6 +669,10 @@ bool FileManager::reloadBuffer(BufferID id) buf->setEncoding(encoding); buf->setUnicodeMode(uniCookie); } + + // Since the buffer will be reloaded from the disk, EOL might have been changed + if (bkformat != EolType::unknown) + buf->setEolFormat(bkformat); } return res; }