mirror of
https://github.com/zyedidia/micro
synced 2024-11-05 17:41:24 +00:00
Merge branch 'cross-compile'
This commit is contained in:
commit
28b07d62e6
85 changed files with 66 additions and 13 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1 +1,2 @@
|
|||
micro
|
||||
binaries/
|
||||
|
|
2
Makefile
2
Makefile
|
@ -7,4 +7,4 @@ install: syn-files build
|
|||
|
||||
syn-files:
|
||||
mkdir -p ~/.micro/syntax
|
||||
cp syntax_files/* ~/.micro/syntax
|
||||
cp -r runtime ~/.micro
|
||||
|
|
3
runtime/README.md
Normal file
3
runtime/README.md
Normal file
|
@ -0,0 +1,3 @@
|
|||
# Runtime files for Micro
|
||||
|
||||
The contents of this directory should be put in `~/.micro`.
|
12
runtime/syntax/README.md
Normal file
12
runtime/syntax/README.md
Normal file
|
@ -0,0 +1,12 @@
|
|||
# Micro syntax highlighting files
|
||||
|
||||
These are the syntax highlighting files for micro. To install them, just
|
||||
put all the syntax files in `~/.micro/syntax`.
|
||||
|
||||
They are taken from Nano, specifically from [this repository](https://github.com/scopatz/nanorc).
|
||||
Micro syntax files are almost identical to Nano's, except for some key differences:
|
||||
|
||||
* Micro does not use `icolor`. Instead, for a case insensitive match, use the case insensitive flag (`i`) in the regular expression
|
||||
* For example, `icolor green ".*"` would become `color green (i) ".*"`
|
||||
* Micro does not support `start="..." end="..."`. Instead use the `s` flag to match newlines and put `.*?` in the middle
|
||||
* For example `color green start="hello" end="world"` would become `color green (s) "hello.*?world"`
|
|
@ -149,9 +149,9 @@ func Match(rules string, buf *Buffer, v *View) map[int]tcell.Style {
|
|||
color := string(submatch[1])
|
||||
var regexStr string
|
||||
if len(submatch) == 4 {
|
||||
regexStr = "(?m" + string(submatch[2]) + ")" + string(submatch[3])
|
||||
regexStr = "(?m" + string(submatch[2]) + ")" + JoinRule(string(submatch[3]))
|
||||
} else if len(submatch) == 3 {
|
||||
regexStr = "(?m)" + string(submatch[2])
|
||||
regexStr = "(?m)" + JoinRule(string(submatch[2]))
|
||||
}
|
||||
regex, err := regexp.Compile(regexStr)
|
||||
if err != nil {
|
||||
|
|
|
@ -268,7 +268,7 @@ func (v *View) HandleEvent(event tcell.Event) int {
|
|||
v.ScrollDown(1)
|
||||
y = v.height + v.topline - 1
|
||||
}
|
||||
if y > len(v.buf.lines) {
|
||||
if y >= len(v.buf.lines) {
|
||||
y = len(v.buf.lines) - 1
|
||||
}
|
||||
if x < 0 {
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
# Micro syntax highlighting files
|
||||
|
||||
These are the syntax highlighting files for micro. To install them, just
|
||||
put them all in `~/.micro/syntax`.
|
||||
|
||||
They are taken from Nano, specifically from [this repository](https://github.com/scopatz/nanorc).
|
||||
Micro syntax files are almost identical to Nano's, except for some key differences:
|
||||
|
||||
* Micro does not use `icolor`. Instead, for a case insensitive match, use the case insensitive flag (`(i)`) in the regular expression
|
46
tools/cross-compile.sh
Executable file
46
tools/cross-compile.sh
Executable file
|
@ -0,0 +1,46 @@
|
|||
cd ..
|
||||
|
||||
mkdir -p binaries
|
||||
mkdir -p micro/bin
|
||||
cp -r runtime micro/
|
||||
|
||||
echo 'mv runtime ~/.micro' >> micro/install.sh
|
||||
chmod +x micro/install.sh
|
||||
|
||||
# Mac
|
||||
echo "OSX 64"
|
||||
GOOS=darwin GOARCH=amd64 go build -o micro/bin/micro ./src
|
||||
tar -czf micro-osx.tar.gz micro
|
||||
mv micro-osx.tar.gz binaries
|
||||
|
||||
# Linux
|
||||
echo "Linux 64"
|
||||
GOOS=linux GOARCH=amd64 go build -o micro/bin/micro ./src
|
||||
tar -czf micro-linux64.tar.gz micro
|
||||
mv micro-linux64.tar.gz binaries
|
||||
echo "Linux 32"
|
||||
GOOS=linux GOARCH=386 go build -o micro/bin/micro ./src
|
||||
tar -czf micro-linux32.tar.gz micro
|
||||
mv micro-linux32.tar.gz binaries
|
||||
echo "Linux arm"
|
||||
GOOS=linux GOARCH=arm go build -o micro/bin/micro ./src
|
||||
tar -czf micro-linux-arm.tar.gz micro
|
||||
mv micro-linux-arm.tar.gz binaries
|
||||
|
||||
rm micro/bin/micro
|
||||
rm micro/install.sh
|
||||
|
||||
echo 'move runtime %HOMEPATH%\.micro' >> micro/install.bat
|
||||
chmod +x micro/install.bat
|
||||
|
||||
# Windows
|
||||
echo "Windows 64"
|
||||
GOOS=windows GOARCH=amd64 go build -o micro/bin/micro.exe ./src
|
||||
zip -r -q -T micro-win64.zip micro
|
||||
mv micro-win64.zip binaries
|
||||
echo "Windows 32"
|
||||
GOOS=windows GOARCH=386 go build -o micro/bin/micro.exe ./src
|
||||
zip -r -q -T micro-win32.zip micro
|
||||
mv micro-win32.zip binaries
|
||||
|
||||
rm -rf micro
|
Loading…
Reference in a new issue