Skip to content

[2GB+] cmdline params structs & session.xml adaptation #11213

@xomx

Description

@xomx

This problem has been identified while fixing #11131 .

Description of the Issue

Some members (_line2go, _column2go and _pos2go) from the CmdLineParams & CmdLineParamsDTO structs (".\PowerEditor\src\Parameters.h") need int to intptr_t change to support 2GB+ files. Saving & loading of the 'session.xml' needs a 2GB+ adaptation too.

Steps to Reproduce the Issue

  1. Open 64-bit N++ (v8.3+).
  2. Load a 2GB+ file (I will use a file with exactly 2 GB = 2147483648 B as an example here).
  3. Make sure you have the 'Remember current session for next launch' checked in Settings -> Preferences... -> Backup.
  4. Scroll down & move cursor to the very end of this file (check that the 'Pos:' in the bottom status bar shows at least 2147483649).
  5. Close the opened N++.
  6. Go to a folder, where you have your 'session.xml' file stored (for portable N++ it will be the same folder, where is the main N++ executable 'notepad++.exe') and open that file.
  7. You will see the result of an int integer overflow - incorrect negative values endPos="-2147483648" startPos="-2147483648"

Expected Behavior

You see correct positive values `endPos="2147483648" startPos="2147483648"

Actual Behavior

After the saved N++ session is restored, the cursor is not at the end of the 2GB file, where it was left before.

@donho
I can do a PR for this if you agree with this proposal.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions