Skip to content

Update code in FileManager::reloadBuffer to correctly detect line endings and encoding#4077

Closed
CookiePLMonster wants to merge 1 commit intonotepad-plus-plus:masterfrom
CookiePLMonster:issues_3557
Closed

Update code in FileManager::reloadBuffer to correctly detect line endings and encoding#4077
CookiePLMonster wants to merge 1 commit intonotepad-plus-plus:masterfrom
CookiePLMonster:issues_3557

Conversation

@CookiePLMonster
Copy link
Copy Markdown
Contributor

@CookiePLMonster CookiePLMonster commented Jan 12, 2018

Fixes #2637, #2843, #3557 and #4033 (maybe more?)

PR seems nearly identical to rejected #2633, however I have actually compiled and tested this and all test cases work fine.

This PR mirrors encoding/EOL detection present in FileManager::loadFile to FileManager::reloadBuffer. As a result, I observed following issues when reloading files modified outside of Notepad++ are fixed:

  • EOF changes get detected and reflected in the GUI
  • If default encoding is set as UTF-8, yet a modified file is a valid ANSI file then encoding gets set as UTF-8 (just like when opening) as opposed to ANSI - that is, default settings are now respected

…ings and encoding of a file when reloading

Fixes #2637, #2843, #3557 and #4033
@donho
Copy link
Copy Markdown
Member

donho commented Jan 28, 2018

@CookiePLMonster The following PR will be chosen for the fix of #4034 due to its simplicity:
#4034

Please redo another PR for the other issues.
Sorry for the inconvenience, thank you for your contribution.

@donho donho closed this Jan 28, 2018
@CookiePLMonster
Copy link
Copy Markdown
Contributor Author

Sure! I'll wait until the other PR is merged and re-submit, so it'll be of narrower scope.

@donho
Copy link
Copy Markdown
Member

donho commented Jan 28, 2018

@CookiePLMonster Done: 46d0f12

@CookiePLMonster
Copy link
Copy Markdown
Contributor Author

@donho PR reissued as #4124

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NP++ has issue changing status bar from ANSI to UTF-8 when the file is changed externally

2 participants