akalongman / akalongman/sublimetext-codeformatter

Exclude files that are from scratch

Đang mở
#259 5 bình luận 0 reaction 0 người được giao Xem trên GitHub
Hacktoberfest
Ngôn ngữ chính
Python
Star
772
Fork
128
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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"
```

2) modify an existing git repository and commit your changes:
```
git add .
git commit
```
( this should open sublime for you to write the commit message. )

3) hit save (I'm on mac so cmd + s). The error from [these lines of the plugin](https://github.com/akalongman/sublimetext-codeformatter/blob/cb45b30ae307718e0868204d4a5b72194ba82570/CodeFormatter.py#L68-L69) 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`)

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.