From cc3ce1a5a4f805e6588158de69e459f0c32fde49 Mon Sep 17 00:00:00 2001 From: Don Ho Date: Sun, 11 Oct 2009 23:51:45 +0000 Subject: [PATCH] [BUG_FIXED] Fixed status bar displaying "-2 char" issue for a empty document. [BUG_FIXED] Fixed installation of NppShell64 failed issue in installer. git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@550 f5eea248-9336-0410-98b8-ebc06183d4e3 --- PowerEditor/installer/nppSetup.nsi | 2 +- PowerEditor/src/Notepad_plus.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/PowerEditor/installer/nppSetup.nsi b/PowerEditor/installer/nppSetup.nsi index 1cf0457a..afe76e91 100644 --- a/PowerEditor/installer/nppSetup.nsi +++ b/PowerEditor/installer/nppSetup.nsi @@ -484,7 +484,7 @@ Section "Context Menu Entry" explorerContextMenu SetOverwrite try SetOutPath "$INSTDIR\" ${If} ${RunningX64} - File /oname=$INSTDIR\nppcm.dll "..\bin\NppShell64.dll" + File /oname=$INSTDIR\NppShell.dll "..\bin\NppShell64.dll" ${Else} File "..\bin\NppShell.dll" ${EndIf} diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index fdf2afdc..87cb3a0f 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -5232,11 +5232,11 @@ size_t Notepad_plus::getCurrentDocCharCount(size_t numLines, UniMode u) { if (u != uniUTF8 && u != uniCookie) { - size_t result = _pEditView->execute(SCI_GETLENGTH); - size_t lines = numLines; - if (_pEditView->execute(SCI_GETCHARAT, result-1) >= ' ') lines--; + int result = _pEditView->execute(SCI_GETLENGTH); + size_t lines = numLines==0?0:numLines-1; if (_pEditView->execute(SCI_GETEOLMODE) == SC_EOL_CRLF) lines *= 2; - return result - lines; + result -= lines; + return ((int)result < 0)?0:result; } else {