sublimetext-codeformatter icon indicating copy to clipboard operation
sublimetext-codeformatter copied to clipboard

Exclude files that are from scratch

Open tconroy opened this issue 8 years ago • 5 comments

I've aliased Sublime Text as my editor for terminal stuff, so when I create a commit, it's opened in Sublime Text for me to write the commit message. This works great, except CodeFormatter throws an error when it opens, "File is From Scratch".

Is there any way to disable that error/notification in these sort of circumstances?

EDIT: steps to reproduce:

  1. set Sublime as your primary editor for Git via the following guide: https://help.github.com/articles/associating-text-editors-with-git/#using-sublime-text-as-your-editor
$ git config --global core.editor "subl -n -w"
  1. modify an existing git repository and commit your changes:
git add .
git commit

( this should open sublime for you to write the commit message. )

  1. hit save (I'm on mac so cmd + s). The error from these lines of the plugin will be thrown.

The save / commit are successful, however the error is really annoying and ruins my workflow ( I have a dedicated virtual desktop for my terminal and the error message causes the active desktop to fling back to my editor ).

This also occurs on save if you amend a commit message (git commit --amend)

tconroy avatar Sep 02 '16 17:09 tconroy

Hi @tconroy, Can you list steps to reproduce your issue ?

  • Creating an alias Sublime Text as my editor for terminal stuff, so when you create a commit.

After re-prodcing your issue, I might be able to resolve it faster.

Thanks, Priyank

priyankt68 avatar Sep 28 '16 06:09 priyankt68

Removing these lines from the source code and trying to format a scratch file doesn't seems to cause any problems.

Any info on why this check is made @akalongman ?

Princesseuh avatar Oct 01 '16 07:10 Princesseuh

Hi @priyankt68, sorry for taking awhile to get back to you. Here are steps to reproduce:

  1. set Sublime as your primary editor for Git via the following guide: https://help.github.com/articles/associating-text-editors-with-git/#using-sublime-text-as-your-editor
$ git config --global core.editor "subl -n -w"
  1. modify an existing git repository and commit your changes:
git add .
git commit

( this should open sublime for you to write the commit message. )

  1. hit save (I'm on mac so cmd + s). The error from these lines of the plugin will be thrown.

The save / commit are successful, however the error is really annoying and ruins my workflow ( I have a dedicated virtual desktop for my terminal and the error message causes the active desktop to fling back to my editor ).

This also occurs on save if you amend a commit message (git commit --amend)

I've edited the OP to add these steps.

tconroy avatar Nov 29 '16 17:11 tconroy

@tconroy Any progress on this one? I am facing the same message and it is annoying.

Kreativschnittstelle avatar Feb 12 '20 10:02 Kreativschnittstelle

hi @Kreativschnittstelle -- sorry, no progress from me. I have long since switched from Sublime to other editors. Hope you can figure out a fix!

tconroy avatar Mar 13 '20 16:03 tconroy