From 4c7cd3f7a07cfd36a26ade4cdf7fe89c3c76f684 Mon Sep 17 00:00:00 2001 From: Don Ho Date: Fri, 1 Dec 2023 23:24:24 +0100 Subject: [PATCH] Fix a LTR setting bug --- PowerEditor/src/NppIO.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/PowerEditor/src/NppIO.cpp b/PowerEditor/src/NppIO.cpp index ea5089ceae13..531d598dede5 100644 --- a/PowerEditor/src/NppIO.cpp +++ b/PowerEditor/src/NppIO.cpp @@ -2119,6 +2119,17 @@ bool Notepad_plus::loadSession(Session & session, bool isSnapshotMode, const wch int mainIndex2Update = -1; + // no session + if (!session.nbMainFiles() && !session.nbSubFiles()) + { + Buffer* buf = getCurrentBuffer(); + if (nppParam.getNativeLangSpeaker()->isRTL() && nppParam.getNativeLangSpeaker()->isEditZoneRTL()) + buf->setRTL(true); + + _mainEditView.changeTextDirection(buf->isRTL()); + return true; + } + for (size_t i = 0; i < session.nbMainFiles() ; ) { const TCHAR *pFn = session._mainViewFiles[i]._fileName.c_str();