Fix 1698#1720
Conversation
This fixes the trailing whitespace stripping behavior on save: - Excludes Markdown and YAML files where trailing whitespace can be semantically meaningful. - Adds description/subtext in the settings switch to clarify that it only applies to syntax-highlighted files, except Markdown and YAML. Fixes elementary#1698
|
Hi @jeremypw, I've implemented the exclusion list and updated the settings switch description to list Markdown and YAML as exclusions, matching the 'smart cut/copy' style. Btw, earlier I was planning to solve both #1698 and #1699 together, but decided to separate them to keep the PR clean. I will submit the PR for #1699 after this is reviewed. |
|
I agree those two issues should be considered in separate PRs, they are not sufficiently interdependent to deal with together. Will review this one shortly. |
|
will create separate PRs for both issues to avoid any conflicts. Thanks for the feedback, looking forward to your review! |
jeremypw
left a comment
There was a problem hiding this comment.
This works as expected.
The only thing I am unsure about is the wording of the label subtext. "Syntax highlighting" may not be turned on and some source languages may not have any visible highlighting yet trailing spaces are still stripped. It may be sufficient just to say "Except Plain Text, MarkDown and YAML"?
|
@jeremypw Let me know if there’s anything else that should be adjusted. |
Dipanshusinghh
left a comment
There was a problem hiding this comment.
This looks good overall and the behavior works as expected.
Only small thing i was wondering about is the wording of the subtext. Since trailing whitespace stripping can still apply even when syntax highlighting is not visibly enabled, maybe something simpler like:
Except Plain Text, Markdown and YAML
might describe the behavior a bit more accurately.
The actual exclusion logic in Document.vala looks clean to me.
You appear to have reviewed your own PR? Is there some AI involvement here? Note that elementaryos only accepts manually written code. Presumably AI assistance for review and translation is OK though. |
|
I don't want to discourage you contributing, which is welcome, just clarify elementaryos policy in this area. |
|
@jeremypw The code and changes in this PR were written by me manually. I do understand and respect elementary OS’s policy around AI-generated code. And thanks again for the review and feedback throughout this PR — I really appreciate it. |
|
@Dipanshusinghh Looks like the updated wording has not been pushed to this PR yet? |
Preferences:- Exclude Markdown and YAML from whitespace stripping
This fix the trailing whitespace stripping behavior on save:--
Fixes Stripping of trailing whitespace affects only some files; no UI indication which types #1698../