Using other editor with TortoiseHg

感情迁移 提交于 2019-12-20 12:32:08

问题


I'm trying to use other editor with TortoiseHG, instead of (Windows) Notepad.

I have tried the solutions mentioned here:

Mercurial and Notepad++ Integration

and here:

https://bitbucket.org/tortoisehg/thg/wiki/OpenAtLine

But no results. When I right-click a file and choose "Edit Local" no file is opened at all, except when I don't set any specific editor (then file is opened in Notepad).

I have tried different editors, like Notepad++ and Sublime Text 2, and no result. Also, I tried to change configuration using "Setting" in GUI, and editing "C:\Users\<my_user>\mercurial.ini"

For example, I tried:

#### # For Sublime Text 2
[tortoisehg]
editor = C:\Program Files\Sublime Text 2\sublime_text.exe [$FILE:$LINENUM]

#### # Or, for NotePad++ :
[tortoisehg]
editor = C:\Program Files (x86)\Notepad++\Notepad++.exe ["$FILE" -n$LINENUM] -multiInst -nosession

What I'm doing wrong?


回答1:


You'll kick yourself...

Change:

[tortoisehg] 
editor = C:\Program Files (x86)\Notepad++\Notepad++.exe ["$FILE" -n$LINENUM] -multiInst -nosession

To:

[tortoisehg]
editor = "C:\Program Files (x86)\Notepad++\Notepad++.exe" ["$FILE" -n$LINENUM] -multiInst -nosession

Note the additional quotes around the path to Notepad++.
I'm guessing it's exactly the same issue with your path to Sublime Text too as both paths contain a space.




回答2:


Strange editor = C:\Program Files (x86)\Notepad++\Notepad++.exe without double quotes worked for me



来源:https://stackoverflow.com/questions/10914688/using-other-editor-with-tortoisehg

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!