LocFromVLoc takes a visual location in the linewrapped buffer and returns the position in the buffer corresponding to this visual location.
(vloc VLoc)
| 332 | // LocFromVLoc takes a visual location in the linewrapped buffer and returns |
| 333 | // the position in the buffer corresponding to this visual location. |
| 334 | func (w *BufWindow) LocFromVLoc(vloc VLoc) buffer.Loc { |
| 335 | if !w.Buf.Settings["softwrap"].(bool) { |
| 336 | tabsize := util.IntOpt(w.Buf.Settings["tabsize"]) |
| 337 | |
| 338 | x := util.GetCharPosInLine(w.Buf.LineBytes(vloc.Line), vloc.VisualX, tabsize) |
| 339 | return buffer.Loc{x, vloc.Line} |
| 340 | } |
| 341 | return w.getLocFromVLoc(vloc) |
| 342 | } |
no test coverage detected