Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add setting to configure rulers shown when committing #441

Merged
merged 1 commit into from Jan 5, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 0 additions & 3 deletions Git Commit Message.sublime-settings

This file was deleted.

3 changes: 3 additions & 0 deletions Git.sublime-settings
Expand Up @@ -37,4 +37,7 @@

// e.g. "Packages/Git/syntax/Git Commit Message.tmLanguage"
,"diff_syntax": "Packages/Diff/Diff.tmLanguage"

// Rulers for commit view
,"commit_rulers": [70]
}
5 changes: 5 additions & 0 deletions commit.py
Expand Up @@ -81,6 +81,7 @@ def porcelain_status_done(self, result):
def diff_done(self, result):
settings = sublime.load_settings("Git.sublime-settings")
historySize = settings.get('history_size')
rulers = settings.get('commit_rulers')

def format(line):
return '# ' + line.replace("\n", " ")
Expand All @@ -100,6 +101,10 @@ def format(line):
msg = self.window.new_file()
msg.set_scratch(True)
msg.set_name("COMMIT_EDITMSG")

if rulers:
msg.settings().set('rulers', rulers)

self._output_to_view(msg, template, syntax=plugin_file("syntax/Git Commit Message.tmLanguage"))
msg.sel().clear()
msg.sel().add(sublime.Region(0, 0))
Expand Down