getSelection returns incorrect values if any lines in buffer are word wrapped
aeronautes opened this issue · comments
aeronautes commented
getSelection works fine if all lines in buffer are shorter than current scratchpad window width. But once a line overflows and is wordwrapped, the calculation for newlines doesn't seem to match what the buffer thinks it is. It's as if window widget adds newlines but the count in textarea doesn't match.
aeronautes commented
Repro:
- start with empty buffer and click L/L button. It should output a latlong entry
- create a line that word wraps the buffer, eg hold down a letter key until it wraps down to another line
- click L/L button again. It should not show any change
- look at dcs.log, it should show something like:
scratchpad-hook.lua"]:124: attempt to perform arithmetic on local 'startByte' (a nil value)