peterh / liner

Pure Go line editor with history, inspired by linenoise
MIT License
1.04k stars 132 forks source link

Fix for #98 #101

Closed filimonov closed 6 years ago

filimonov commented 6 years ago

Changing the approach of fixing https://github.com/peterh/liner/issues/71 (introduced by 0e4af131b90a9786839c8b1b01717be263e8555a).

Instead of 'decreasing' screen width for cases when cursor take extra column, increment the calculated user input length.

With correct screen width multiline mode works properly.

filimonov commented 6 years ago

Now there are issues in multiline mode on the end of the screen. I will try do git it deeper.

UPD: hmm... heisenbug. Yesterday i suddenly start getting problems with cursor placement on Windows. Today (the same binary, under the same conditions) - everything works properly. May be some misbehaviour of windows console itself?

peterh commented 6 years ago

Thanks for the patch.

Heisenbug or not, I like the approach of incrementing the calculated length instead of decrementing the detected width, so I pulled.