Fix formatting
All checks were successful
timw4mail/gilo/pipeline/head This commit looks good

This commit is contained in:
Timothy Warren 2021-04-02 19:24:58 -04:00
parent 052a4ebbf4
commit 52aa174091
3 changed files with 5 additions and 5 deletions

View File

@ -96,7 +96,7 @@ func (d *Document) InsertRow(at int, s string) {
// Split the array of rows at the specified index
start := d.rows[0:at]
end := d.rows[at : d.RowCount()]
end := d.rows[at:d.RowCount()]
// Splice it back together
newRows = append(newRows, start...)
@ -114,7 +114,7 @@ func (d *Document) InsertNewline(at *gilo.Point) {
row := d.rows[at.Y]
// Insert the characters right of the cursor to the next line
d.InsertRow(at.Y + 1, string(row.chars[at.X:row.Size()]))
d.InsertRow(at.Y+1, string(row.chars[at.X:row.Size()]))
// Remove the characters copied to the next line
row.chars = row.chars[0:at.X]

View File

@ -103,7 +103,7 @@ func (e *editor) Prompt(prompt string) string {
e.SetStatusMessage("")
return buf.ToString()
} else if ! key.IsCtrl(ch) && key.IsAscii(ch) {
} else if !key.IsCtrl(ch) && key.IsAscii(ch) {
buf.AppendRune(ch)
}
}
@ -139,7 +139,7 @@ func (e *editor) delChar() {
e.cursor.X = e.document.GetRow(e.cursor.Y - 1).Size()
// Move the contents of the current row to the previous
e.document.MergeRows(e.cursor.Y - 1, e.cursor.Y)
e.document.MergeRows(e.cursor.Y-1, e.cursor.Y)
e.cursor.Y -= 1
}