Skip to content

Commit

Permalink
Fix confusing memory allocation error message (reused FileTooBigToOpen)
Browse files Browse the repository at this point in the history
  • Loading branch information
xomx authored and donho committed Dec 2, 2023
1 parent 0978b2e commit ffc0ed2
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion PowerEditor/installer/nativeLang/czech.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<!--
- last change: Notepad++ 8.6 23/Nov/2023 by Ondřej Müller ([email protected])
- last change: Notepad++ 8.6 30/Nov/2023 by Ondřej Müller ([email protected])
- N++ Community QA: https://notepad-plus-plus.org/community/topic/87/czech-translations
- contributors: Ondřej Müller ([email protected]), Tomáš Hrouda ([email protected]), Martin Darebný (darBis)
- the most recent version of this file can be downloaded from the project master-branch here: https://github.com/notepad-plus-plus/notepad-plus-plus/blob/master/PowerEditor/installer/nativeLang/czech.xml
Expand Down Expand Up @@ -1509,6 +1509,7 @@ Přejete si použít takovéto zástupné dokumenty/karty?
POZNÁMKA: Jestliže se rozhodnete neotevírat zástupné dokumenty/karty anebo je poté sami zavřete, Vaše relace BUDE PŘI UKONČENÍ Notepadu++ automaticky MODIFIKOVÁNA!
Doporučujeme Vám, abyste si nyní zazálohovali Váš soubor &quot;session.xml&quot;."/>
<RTLvsDirectWrite title="Nelze použít směr textu RTL" message="RTL není v současnosti kompatibilní se zvoleným DirectWrite režimem. Prosím vypněte nejprve DirectWrite v sekci &quot;Různé&quot; v &quot;Nastavení&quot;, poté restartujte Notepad++ a použijte znovu tento příkaz."/>
<FileMemoryAllocationFailed title="Problém s alokací paměti pro soubor" message="Pravděpodobně není dostatek souvislé volné paměti pro soubor, který Notepad++ právě načítá."/><!-- HowToReproduce: Try to open multiple files with total size > ~700MB in the x86 Notepad++ (it will depend on the PC memory configuration and the current system memory usage...). -->
</MessageBox>

<ClipboardHistory>
Expand Down
1 change: 1 addition & 0 deletions PowerEditor/installer/nativeLang/english.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1506,6 +1506,7 @@ Would you like to create those placeholders?
NOTE: Choosing not to create the placeholders or closing them later, your session WILL BE MODIFIED ON EXIT! We suggest you backup your &quot;session.xml&quot; now."/>
<RTLvsDirectWrite title="Cannot run RTL" message="RTL is not compatible with DirectWrite mode. Please disable DirectWrite mode in MISC. section of Preferences dialog, restart Notepad++, and try this command again."/>
<FileMemoryAllocationFailed title="Exception: File memory allocation failed" message="There is probably not enough contiguous free memory for the file being loaded by Notepad++."/><!-- HowToReproduce: Try to open multiple files with total size > ~700MB in the x86 Notepad++ (it will depend on the PC memory configuration and the current system memory usage...). -->
</MessageBox>
<ClipboardHistory>
<PanelTitle name="Clipboard History"/>
Expand Down
1 change: 1 addition & 0 deletions PowerEditor/installer/nativeLang/english_customizable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1506,6 +1506,7 @@ Would you like to create those placeholders?
NOTE: Choosing not to create the placeholders or closing them later, your session WILL BE MODIFIED ON EXIT! We suggest you backup your &quot;session.xml&quot; now."/>
<RTLvsDirectWrite title="Cannot run RTL" message="RTL is not compatible with DirectWrite mode. Please disable DirectWrite mode in MISC. section of Preferences dialog, restart Notepad++, and try this command again."/>
<FileMemoryAllocationFailed title="Exception: File memory allocation failed" message="There is probably not enough contiguous free memory for the file being loaded by Notepad++."/><!-- HowToReproduce: Try to open multiple files with total size > ~700MB in the x86 Notepad++ (it will depend on the PC memory configuration and the current system memory usage...). -->
</MessageBox>
<ClipboardHistory>
<PanelTitle name="Clipboard History"/>
Expand Down
6 changes: 3 additions & 3 deletions PowerEditor/src/ScintillaComponent/Buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1718,10 +1718,10 @@ bool FileManager::loadFileData(Document doc, int64_t fileSize, const TCHAR * fil
break;
case SC_STATUS_BADALLOC:
{
pNativeSpeaker->messageBox("FileTooBigToOpen",
pNativeSpeaker->messageBox("FileMemoryAllocationFailed",
_pNotepadPlus->_pEditView->getHSelf(),
TEXT("File is too big to be opened by Notepad++"),
TEXT("Exception: File size problem"),
TEXT("There is probably not enough contiguous free memory for the file being loaded by Notepad++."),
TEXT("Exception: File memory allocation failed"),
MB_OK | MB_APPLMODAL);
}
[[fallthrough]];
Expand Down

0 comments on commit ffc0ed2

Please sign in to comment.