Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getSelection returns incorrect values if any lines in buffer are word wrapped #66

Open
aeronautes opened this issue Sep 19, 2024 · 1 comment

Comments

@aeronautes
Copy link
Collaborator

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
Copy link
Collaborator Author

Repro:

  1. start with empty buffer and click L/L button. It should output a latlong entry
  2. create a line that word wraps the buffer, eg hold down a letter key until it wraps down to another line
  3. click L/L button again. It should not show any change
  4. look at dcs.log, it should show something like:
    scratchpad-hook.lua"]:124: attempt to perform arithmetic on local 'startByte' (a nil value)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant