Coder Social home page Coder Social logo

Comments (1)

scholer avatar scholer commented on September 27, 2024

Yeah, I can see that might be annoying. Although what we really need is just to not trim the current line; I would like to trim other lines that I am done working on. Otherwise the auto-saved version would be too different from the "ctrl+s" manually saved file. Other editors (e.g. Komodo Edit) has an option to not trim the current line when trimming trailing white spaces.

As a short term solution, you can increase the auto-save delay, but I can see that's not really an optimal solution. A better solution might be to have auto-save manually trim the current view, but exclude the current line. AFAIK, it is not possible to alter the behaviour of Sublime Text when saving, i.e. if you have trim_trailing_white_space_on_save enabled, then sublime text will trim trailing white spaces, just like when you manually save with ctrl+s. And there is nothing we can do from the plugin side to change that. Other than, perhaps, toggling trim_trailing_white_space_on_save off before saving, and on again after saving.

This does seem a bit like another example where it would be nice to customize how the API save command is invoked. We have a similar case where we don't want Sublime Text to hide word completions when saving (PR #27). In other words, it would be nice to be able to invoke save with something like: view.run_command("save", {"trim_trailing_white_spaces": False, "hide_autocomplete_popup": False})) -- where the second argument is a dict to customize the behaviour of the save command, in this case not hiding autocomplete popups and not trimming trailing white spaces.

from auto-save.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.