-
-
Notifications
You must be signed in to change notification settings - Fork 112
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
Move strip trailing whitespace into main code; remove plugin #1151
Conversation
# Conflicts fixed in: # src/Services/Document.vala
# Conflicts fixed in: # plugins/meson.build
* Limit scope of undoable action * Do not strip when loading or empty
Bug found - converting to draft while fixing. |
Reduced scope of PR so that current behaviour (strip only on manual save or close) is unaffected. Stripping on autosave would be easy to add later if required. |
The problem with CI appears unrelated to this PR - it compiles OK locally. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me
A possible refinement is to have the "strip trailing whiltespace" functionality independent of saving so that it occurs even if "autosave" is off. |
Hmmm how would that look separated from saving? Remove the trailing white space when a user starts a new line? |
No, I found it too intrusive for stripping to occur immediately after leaving a line. For example, I like to insert a blank line and the closing brace of an |
Gotcha. Do you think that might not do it often enough? If I write a quick fix, or just code for a short time, in a single doc and close Code it sounds like it wouldn't strip. Not a frequent scenario but one I can picture happening. |
I think #1188 might be relevant here - this could also ensure stripping occurs. |
Yeah that seems good. Personally the more places it checks and does the stripping without interfering the better so it ensures a consistent experience. Losing focus, on saves, etc are all good places to me. |
@zeebok Is it OK to merge this PR (which should behave pretty much the same as master, without regressions) and make changes to behaviour in future PRs? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am in favor of moving plugins into the main source for sure 👍
Instead of using the phrase "blacklist" here, can we use "blocklist" instead?
I think this should be handled from the package side, for source installations, we should recommend doing an For the deb package, aren't plugins installed in the same package? so when an update occurs, they all got removed and only the ones in the new build installed? the flatpak package aren't affected by this. |
@Marukesu I didn't realise Code has an |
Yeah the Deb package will cleanup old installed files like plugins so this only affects source installs |
Moved to main codebase in #1151
Fixes #1098
A hopefully minor behavior change is that stripping (and saving) now occurs whenever the document loses focus as well as on manual saving.
Stripping does not occur on every autosave as it could interfere unacceptably with ongoing editing.
An issue raised by this is what to do about the already installed plugin - this PR overwrites it so that it does not appear in the Extensions dialog. Alternative solutions welcome.
I guess that once the app is supplied only as a Flatpak this will not be an issue and the plugin overwriting code can be removed.