annotate_models icon indicating copy to clipboard operation
annotate_models copied to clipboard

Do not delete leading empty lines

Open thinca opened this issue 3 years ago • 0 comments

Source code may have magic comments.

# frozen_string_literal: true

# == Schema Information
#
# Table name: foo
#
#  id                  :integer         not null, primary key
#  created_at          :datetime
#  updated_at          :datetime
#

class Foo < ActiveRecord::Base
end

In this case, the blank line before the annotation should not be erased by annotate --delete.

Expected:

# frozen_string_literal: true

class Foo < ActiveRecord::Base
end

But actual:

# frozen_string_literal: true
class Foo < ActiveRecord::Base
end

This change fixes it.

thinca avatar Sep 06 '20 13:09 thinca