Hi there,
I'm new to SciTE, using version 3.7.4 on Linux.
Is anyone using this editor for Go (
golang.org)?
Google turned up this
http://go-lang.cat-v.org/text-editors/scite/ and from what I understand it kinda retrofits the CPP syntax highlighter for Go.
Syntax highlighting aside, Golang has another peculiarity... it likes to run any and all code through its indenter, gofmt. This is an external program similar to HTML Tidy that produces properly formatted code, and it'll either print to stdout or change the file directly.
Only problem is, I can't get it to work. The SciTE FAQ has an example for HTML Tidy here
http://www.scintilla.org/SciTEFAQ.html but that doesn't work for me, either.
I ended up with this is in my SciTEUser.properties:
command.name.0.*.go=gofmt
command.0.*.go=gofmt -w $(FilePath)
command.mode.0.*.go=filter:yes,savebefore:yes
command.name.1.*.html=HTML Tidy
command.1.*.html=tidy -i -wrap 0 -m $(FilePath)
command.is.filter.1.*.html=1
The command shows up in the menu, the program actually runs and successfully changes the file. And scite shows it ran gofmt, exit code 0. Okay.
But I still have to manually select File -> Revert to make those changes show up in the editor. Ideally I would like this to happen automatically and for gofmt to run whenever I save the file and if undo history could be preserved somehow that'd be really great.
I thought the "filter" would be the flag responsible for that but there does not seem to be any change no matter how I set it.
Is it possible?
Kind regards
Andreas Klauer