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

Turbo removes trailing spaces on save #74

Open
coolcoder613eb opened this issue May 13, 2024 · 4 comments
Open

Turbo removes trailing spaces on save #74

coolcoder613eb opened this issue May 13, 2024 · 4 comments

Comments

@coolcoder613eb
Copy link

How can I disable this behaviour?

@magiblot
Copy link
Owner

Hi @coolcoder613eb!

Unfortunately, it is not currently possible to customize this from inside the application. I am sorry that this feature caused you trouble.

If you have compiled Turbo yourself, you can disable this behaviour by commenting out the call to stripTrailingSpaces in FileEditor::beforeSave:

--- a/source/turbo-core/fileeditor.cc
+++ b/source/turbo-core/fileeditor.cc
@@ -232,7 +232,7 @@ void FileEditor::beforeSave() noexcept
     if (!inSavePoint() && !call(scintilla, SCI_CANREDO, 0U, 0U))
     {
         call(scintilla, SCI_BEGINUNDOACTION, 0U, 0U);
-        stripTrailingSpaces(scintilla);
+        // stripTrailingSpaces(scintilla);
         ensureNewlineAtEnd(scintilla);
         call(scintilla, SCI_ENDUNDOACTION, 0U, 0U);
     }

@coolcoder613eb
Copy link
Author

I think it would be better to disable it by default, as it is very hard to write markdown with it.

@magiblot
Copy link
Owner

Could you please share an example of a Markdown file that is very hard to edit because of this feature?

@coolcoder613eb
Copy link
Author

In markdown, you put two spaces at the end of a line to do a newline.
Those two spaces get stripped.

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

No branches or pull requests

2 participants