dk / Prima

prima.eu.org
Other
106 stars 27 forks source link

Text editor selection is weird #37

Closed run4flat closed 8 years ago

run4flat commented 8 years ago

Text selection gives the wrong result due to incorrect logic in selection_to_physical. I am not sure what the function is trying to achieve, so I am not sure how to fix things.

To reproduce the problem, run the text editor example script (editor.pl). Type abc in the first row and def in the second row. Select from c to d, over the newline (Shift-Down-Left). Copy, then paste into another text editor. I get bc\nde instead of the expected c\nd.

I am running v1.44, but it persists in the latest repository, I believe.

run4flat commented 8 years ago

Here is an example of the selection: editor

and the result of the paste into another text editor: pasted-results

dk commented 8 years ago

Hi David,

I can't reproduce the exact results you're getting, but mine resuls are weird too. I think I've fixed it. The problem the function was trying to fix was the case for newly implemented bidirectional edit. Please take a look if it works for you.

/dk