Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RC build 1690: converting line endings #1168

Closed
craigo- opened this issue May 3, 2019 · 6 comments
Closed

RC build 1690: converting line endings #1168

craigo- opened this issue May 3, 2019 · 6 comments

Comments

@craigo-
Copy link

craigo- commented May 3, 2019

Notepad3 (64-bit) v5.19.503.1690 RC.

I've noticed that the status bar indicator for line endings does not change when the user responds to the prompt and changes line endings in a file with inconsistent line endings.

Steps to reproduce:

  1. Open a file with inconsistent line endings - you will receive the following dialogue:
    image
  2. Respond by changing the line endings to LF (not the default) and click Yes:
    image
  3. Notice the status bar displays CR+LF:
    image
  4. Close and save the file, then reopen it. The status bar now displays LF:
    image

Is this the correct behaviour for the line endings area of the status bar? Is it there to display the structure of the opened file, or the behaviour of the program? At present it seems to do both, i.e. double-clicking the status bar element changes all line endings (and marks the file as dirty), but when opening a file with inconsistent line endings the status bar does not reflect this; it then shows the program's line ending behaviour for new edits.

Proposal: in the instance where a user opens a file with mixed line endings:

  • If the user makes them consistent, the status bar indicator follows the selected option (if the user chooses to make all line endings consistent, it makes sense to me that they would want subsequent edits to follow the same setting)
  • If the user chooses not to make line endings consistent, we have a new status bar indicator: {default_setting}* (e.g. CR+LF*) - to show that the file currently has inconsistent line endings, but the program's default behaviour is to add line endings in the indicated manner.

How does that sound?

@RaiKoHoff
Copy link
Collaborator

Please test beta version _5.19.504.1691_RC (see beta-channel access #1129).

Remarks: The inconsistency check is only done on loading a file. It is assumed, that any change of EOL-Mode creates an EOL-consistent document, reflected in the status-bar.
If you intentionally break the consistency (e.g. regex replacing some \r\n by \r) this will not be detected and the status-bar will not reflect this (until next file load).
The reason is: status-bar updates must be very fast, EOL-inconsistency detection is (quite) slow.
But I think, breaking EOL-consistency intentionally is a pathological case - no need to take care for.

@craigo-
Copy link
Author

craigo- commented May 5, 2019

v5.19.504.1691 RC:

Almost...

The second bullet point (new status bar indicator for inconsistent line endings) works well - thanks.

What I was proposing in the first bullet point was that after the user chooses to make a file's line endings consistent, the line endings mode (as displayed in the status bar) should also change to the same setting. i.e. in the steps to reproduce, step 3 should display LF. The reasoning being if the user chooses to change the file's line endings to a particular setting, it then follows that they will probably want to make subsequent edits using the same setting.

@hpwamr
Copy link
Collaborator

hpwamr commented May 5, 2019

Hello @RaiKoHoff ,
The second request for @craigo- seems reasonable. 🤔

  • If the user chooses to normalize all incoherent lines, for example in "LF", it seems normal to me that the new state of the indicator shows "LF".

2019-05-05_062845

@RaiKoHoff
Copy link
Collaborator

Sorry, I missed this point.
Please test beta version _5.19.505.1692_RC (see beta-channel access #1129).

@hpwamr
Copy link
Collaborator

hpwamr commented May 5, 2019

Tested: version _5.19.505.1692_RC, it's displayed according the the "Normalize" settings. 😃

As far as I am concerned, this issue may be closed....

@craigo-
Copy link
Author

craigo- commented May 6, 2019

Tested v5.19.505.1693 RC. Agreed. Thanks, @RaiKoHoff.

@craigo- craigo- closed this as completed May 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants