sublimetext-codeformatter
sublimetext-codeformatter copied to clipboard
Exclude files that are from scratch
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:
- 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"
- modify an existing git repository and commit your changes:
git add .
git commit
( this should open sublime for you to write the commit message. )
- 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
)
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
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 ?
Hi @priyankt68, sorry for taking awhile to get back to you. Here are steps to reproduce:
- 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"
- modify an existing git repository and commit your changes:
git add .
git commit
( this should open sublime for you to write the commit message. )
- 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 Any progress on this one? I am facing the same message and it is annoying.
hi @Kreativschnittstelle -- sorry, no progress from me. I have long since switched from Sublime to other editors. Hope you can figure out a fix!