Sublime Forum

[SublimeHg] Using Sublime Text 2 as the Mercurial editor

#1

Hey there, I’m running Windows 7 64-bit and am using Sublime Text 2 Beta, Build: 2165. I installed SublimeHg via the Package Control package and after discovering the CLI that SublimeHg provides, made the Sublime Text 2 executable my default editor for Mercurial commit-messages.

[ui] ... editor = "C:\Program Files\Sublime Text 2\sublime_text.exe"
The problem is the following:> hg commit abort: empty commit message
This happens instantly after having typed “commit” and although a new tab opens that would potentially allow me to enter the commit message, it’s useless at that point – this only leaves me with directly passing the actual message via the “-m” command-line parameter.

Am I forgetting something? And if I am not: Could SublimeText 2 possibly implement a command-line parameter that would keep the “command-line channel”, for a lack of a better term, open until the tab, in which the file is opened, is closed?

0 Likes

New Mercurial plugin for Sublime Text 2
#2

Sublime Text on Windows won’t block, so you can’t use it as your $HGEDITOR.

My plan is to collect input for Mercurial commands that need it in a separate buffer within Sublime Text and then forward it to the command when you close the input buffer. In the meantime, I suggest you to use notepad2 or notepad as your Mercurial editor.

0 Likes

#3

That’s too bad – thanks for SublimeHg, and I’m looking forward to those additions.

0 Likes

#4

Hey there, I implemented my suggested feature and it works more or less. Maybe you can reuse/incorporate some of my code.

0 Likes