Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Set Line Endings improvement #315

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

Closed
ghost opened this issue Aug 29, 2024 · 6 comments
Closed

Set Line Endings improvement #315

ghost opened this issue Aug 29, 2024 · 6 comments
Assignees
Labels
enhancement New feature or request ready for release

Comments

@ghost
Copy link

ghost commented Aug 29, 2024

I have a text file created by Geany on Linux that uses Linux line endings. I want to change it to use Windows line endings. I selected Windows line endings. But nothing happened. I realized I need to type something into the document, save it (and then delete the dummy text I have typed and save again), for it to actually change the line endings from Linux to Windows.

With Geany, when you select the new line endings, it will update the document immediately. I can understand the decision of ecode because Geany's behavior is bad for large text files. But instead of having me use the trick I described, ecode should ask me if I want to change to the new line endings and let me choose. It could be more clever, that is, only ask when the new line endings are different from the current ones.

Repository owner deleted a comment from Anubi5x0 Aug 29, 2024
@SpartanJ SpartanJ self-assigned this Aug 29, 2024
@SpartanJ SpartanJ added the enhancement New feature or request label Aug 29, 2024
@SpartanJ
Copy link
Owner

Makes sense, it should give some feedback to the user, i'll think about how to solve it. I don't like saving the file, and I don't like showing too many message boxes.

@ghost
Copy link
Author

ghost commented Aug 29, 2024

Makes sense, it should give some feedback to the user, i'll think about how to solve it. I don't like saving the file, and I don't like showing too many message boxes.

You could copy Geany's behavior. Geany updates the document immediately when you choose new line endings but it doesn't save the file. It marks the document as modified and let the user decided to save it or not. ecode can't handle even a 10mb json file (#311), so you could drop the consideration for performance when handling large text files.

@SpartanJ
Copy link
Owner

You could copy Geany's behavior. Geany updates the document immediately when you choose new line endings but it doesn't save the file. It marks the document as modified and let the user decided to save it or not.

I'll do that.

ecode can't handle even a 10mb json file (#311), so you could drop the consideration for performance when handling large text files.

ecode can handle perfectly fine 10mb json files, what it does not handle gracefully is huge single line files, which aren't usually expected to be used for editing, so I don't care about it.
Example, handling +25mb files, including a single line one. And I can't show you other editors because they take too long to even open and won't do highlighting (not even vscode). So I'm happy enough with current ecode's capabilities. I closed the issue because he didn't share the file and cannot reproduce. If you can reproduce the issue please share the file that triggers it for you.

2024-08-29.13-23-53.mp4

@Curculigo
Copy link

Curculigo commented Aug 29, 2024

@SpartanJ Try to stringify these JSONs and open them with ecode to see if ecode can handle it. My JSON file is indeed a bookmarks backup generated by Firefox. Imagine you have a bunch of obsolete domains that you want to use the editor's find and replace feature to replace with new domains. I don't think for such a simple task I need to use a real programming language. I don't care if this JSON has syntax highlighting or not.

Btw, I found this addon that solved my problem without having to use the JSON backup file:

https://addons.mozilla.org/en-US/firefox/addon/bookmark-url-batch-replacer/

@SpartanJ
Copy link
Owner

Yes, it does work for me. Without syntax highlighting it will work faster given that the most expensive task is disabled, that's why other editors do not even try to do syntax highlighting for those cases. If you have the crash log please share it.

There are a few things I can disable to improve the overall experience and I guess that's what you encountered:

  1. Disable matching brackets (finding matching brackets for huge files can be really really expensive).
  2. Disable creating the auto-complete dictionary, this is currently being limited by line count but not file size, i'll add that, because for single line examples is critical.
  3. Disable syntax highlighting for huge single line files.

You can try doing that manually, it might work / help.

@SpartanJ
Copy link
Owner

Done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request ready for release
Projects
None yet
Development

No branches or pull requests

2 participants