Search code examples
sublimetext

Sublime Text: How to hide the last line number which contains the preserved blank line?


Currently in my configuration, Sublime will always preserve a blank line on the bottom of every file when saving. Since the last line is blank, is there any option to hide the appropriate line number?

NOTE: If there was no option in Sublime, is it possible to write a custom extension or plugin to handle it?

Really appreciate for any help,


Solution

  • The only way to do this is to eliminate the last line by using the following setting:

    "ensure_newline_at_eof_on_save": false
    

    Sublime is programmed such that when a line is terminated by a newline character (hex 0A, ASCII character 10), the next line is shown, which intuitively is the correct thing to do. All text editors that I know of have this behavior. Therefore, the only way to "hide" the last line number in the gutter is to not have a newline character terminating the previous line.