Intellij-elixir: Strip trailing spaces

Created on 22 Jun 2017  路  6Comments  路  Source: KronicDeth/intellij-elixir

Thank you so much for awesome plugin!

I experienced a problem with striping trailing spaces after saving a file.

Let's say we have a code:

defmodule Foo do
  def bar do
  end

  def baz do
  end
end

I would expect that after saving a file those spaces in the line between functions will be striped. RubyMine behaves like that in case of Ruby code.

What do you think?

Bug

Most helpful comment

This is fixed when I test it on master

All 6 comments

Strip trailing spaces on save is a general editor setting. It's not implemented as a language-specific extension. You should already have access to it. If you're using IntelliJ it's

  1. Select from the main menu IntelliJ IDEA > Preferences
    screen shot 2017-06-22 at 8 28 27 pm
  2. In the Preferences dialog go to Editor > General
    screen shot 2017-06-22 at 8 28 41 pm
    screen shot 2017-06-22 at 8 28 50 pm
  3. Select "All" from the "Strip trailing spaces on Save" dropdown
    screen shot 2017-06-22 at 8 28 55 pm

  4. Click "OK"

If those instructions don't work for you let me know.

Thank you for the response!

Yup, I enabled this option.

image

Generally trailing spaces works fine in case I have some code at this line and white spaces at the end of the line. It doesn't work if the line contains only white spaces.

In case of Ruby code it works fine, which is really weird.

Another example that illustrates the issue:

defmodule Foo do
  def bar do
  end  #spaces here will be removed
  #spaces here will not be removed
end

This might be fixed when #98 lands, but I'll leave it open until I can confirm.

@KronicDeth Awesome! Thank you so much!

This is fixed when I test it on master

Works fine! Thank you!

Was this page helpful?
0 / 5 - 0 ratings