Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/buffer/loc.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func (l Loc) Move(n int, buf *Buffer) Loc {
return l.MoveLA(n, buf.LineArray)
}

// ByteOffset is just like ToCharPos except it counts bytes instead of runes
// ByteOffset converts an x, y position into a byte offset in the buffer
func ByteOffset(pos Loc, buf *Buffer) int {
x, y := pos.X, pos.Y
loc := 0
Expand Down