Home Download Buy Blog Forum Support

[SublimeHg] Using Sublime Text 2 as the Mercurial editor

[SublimeHg] Using Sublime Text 2 as the Mercurial editor

Postby cryzed on Sat Jan 14, 2012 5:16 pm

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.
Code: Select all
[ui]
...
editor = "C:\Program Files\Sublime Text 2\sublime_text.exe"

The problem is the following:
Code: Select all
> 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?
cryzed
 
Posts: 13
Joined: Sat Jan 14, 2012 5:10 pm

Re: [SublimeHg] Using Sublime Text 2 as the Mercurial editor

Postby guillermooo on Sat Jan 14, 2012 5:56 pm

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.
guillermooo
 
Posts: 718
Joined: Thu Jul 23, 2009 9:06 am

Re: [SublimeHg] Using Sublime Text 2 as the Mercurial editor

Postby cryzed on Sat Jan 14, 2012 6:54 pm

That's too bad -- thanks for SublimeHg, and I'm looking forward to those additions.
cryzed
 
Posts: 13
Joined: Sat Jan 14, 2012 5:10 pm

Re: [SublimeHg] Using Sublime Text 2 as the Mercurial editor

Postby cryzed on Sun Jan 15, 2012 8:12 pm

Hey there, I implemented my suggested feature and it works more or less. Maybe you can reuse/incorporate some of my code.
cryzed
 
Posts: 13
Joined: Sat Jan 14, 2012 5:10 pm


Return to Technical Support

Who is online

Users browsing this forum: No registered users and 21 guests

cron