Fix incoherence about supporting 2GB+ files

This commit is contained in:
Don Ho 2022-02-24 01:48:28 +01:00
parent 11128e5c3e
commit bfbad49cf4
2 changed files with 5 additions and 5 deletions

View File

@ -4061,9 +4061,7 @@ void Finder::add(FoundInfo fi, SearchResultMarking mi, const TCHAR* foundline)
str += _prefixLineStr;
str += TEXT(" ");
TCHAR lnb[16];
wsprintf(lnb, TEXT("%d"), static_cast<int>(fi._lineNumber));
str += lnb;
str += std::to_wstring(fi._lineNumber);
str += TEXT(": ");
mi._start += str.length();
mi._end += str.length();

View File

@ -21,6 +21,7 @@
#include "shortcut.h"
#include "Parameters.h"
#include "Notepad_plus.h"
#include <strsafe.h>
void Command::extractArgs(TCHAR* cmd2Exec, size_t cmd2ExecLen, TCHAR* args, size_t argsLen, const TCHAR* cmdEntier)
@ -145,8 +146,9 @@ void expandNppEnvironmentStrs(const TCHAR *strSrc, TCHAR *stringDest, size_t str
TCHAR expandedStr[CURRENTWORD_MAXLENGTH] = { '\0' };
if (internalVar == CURRENT_LINE || internalVar == CURRENT_COLUMN)
{
int lineNumber = static_cast<int>(::SendMessage(hWnd, RUNCOMMAND_USER + internalVar, 0, 0));
wsprintf(expandedStr, TEXT("%d"), lineNumber);
size_t lineNumber = ::SendMessage(hWnd, RUNCOMMAND_USER + internalVar, 0, 0);
std::wstring lineNumStr = std::to_wstring(lineNumber);
StringCchCopyW(expandedStr, CURRENTWORD_MAXLENGTH, lineNumStr.c_str());
}
else
::SendMessage(hWnd, RUNCOMMAND_USER + internalVar, CURRENTWORD_MAXLENGTH, reinterpret_cast<LPARAM>(expandedStr));