Sublime Forum

BUG: unwanted newlines with ensure_newline_at_eof_on_save

#1

ST2: v2.0.1, Build 2217
OSX 10.8.3, Build 12D78
registered user

Steps to reproduce:

  1. set: “ensure_newline_at_eof_on_save”: true
  2. open an existing file
  3. place cursor on the very last line
  4. type: test

Expected result: the word “test” on the last line

Actual result:

t es t

If I type the alphabet, I get:

abcd efghijklmnopq rs tu vw xyz

It appears the letters e, r, t, v, and x trigger the bug.

Mitigating factors:

  1. The issue does NOT appear if you type on the penultimate line, or any other line except the last.
  2. The issue does NOT appear if you set: “ensure_newline_at_eof_on_save”: false

Alternate steps to reproduce:

  1. set: “ensure_newline_at_eof_on_save”: true
  2. create a new (unsaved) file
  3. type: test

Actual result: when you type “e”, a “save file” dialog box pops up. You must hit “cancel” 8 times before you’re returned to the file. The first 7 times you click “cancel”, the “save” dialog closes, then instantly re-opens.

Please let me know if you need any more information regarding this issue. Thanks.

0 Likes

#2

What plugins do you have installed? I can’t reproduce this, and I’d be very surprised if it weren’t the result of a plugin.

0 Likes

#3

Good call, @adzenith. It appears to be an issue with the sublime-text-2-ruby-tests plugin: github.com/maltize/sublime-text … issues/156

For the record, I’ve successfully reproduced this issue on ST2 and ST3.

Moving this issue over to the plugin issue tracker. Thanks for pointing me in the right direction, @adzenith

0 Likes