Mercurial > hg
changeset 32345:a438f5a3bc09
contrib: make editmergeps able to work with notepad++
Notepad++ has a different FIRSTLINE argument, so needs special handling.
author | Kostia Balytskyi <ikostia@fb.com> |
---|---|
date | Fri, 19 May 2017 17:01:34 -0700 |
parents | 864fc285d10a |
children | 73e67c4386ec |
files | contrib/editmergeps.ps1 |
diffstat | 1 files changed, 11 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/contrib/editmergeps.ps1 Fri May 19 17:00:55 2017 -0700 +++ b/contrib/editmergeps.ps1 Fri May 19 17:01:34 2017 -0700 @@ -35,7 +35,8 @@ exit 1 } -if (($ed -eq "vim") -or ($ed -eq "emacs") -or ($ed -eq "nano")) +if (($ed -eq "vim") -or ($ed -eq "emacs") -or ` + ($ed -eq "nano") -or ($ed -eq "notepad++")) { $lines = Get-Lines $firstline = if ($lines.Length -gt 0) { $lines[0] } else { $nil } @@ -46,6 +47,15 @@ # or the user stops editing the file while (($firstline -ne $nil) -and ($firstline -ne $previousline)) { + if ($ed -eq "notepad++") + { + $linearg = "-n$firstline" + } + else + { + $linearg = "+$firstline" + } + Start-Process -Wait $ed $linearg,$file $previousline = $firstline $lines = Get-Lines