Skip to content

Commit

Permalink
fix: only skew lines that begin with G1 or G2 (ignoring indentation)
Browse files Browse the repository at this point in the history
  • Loading branch information
olistrik committed Mar 20, 2023
1 parent 61782a8 commit 3b92e99
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion goskew.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func skew(input []byte, xytan float64, xztan float64, yztan float64) string {
zreg, _ := regexp.Compile(`[zZ](-?\d*\.?\d*)`)

for i, line := range lines {
gmatch, _ := regexp.MatchString(`G[0-1]`, line)
gmatch, _ := regexp.MatchString(`^\s*G[0-1]`, line)

if gmatch {
// find X, Y, and Y coords in line
Expand Down

0 comments on commit 3b92e99

Please sign in to comment.