Closed System-Glitch closed 3 years ago
Thanks for getting this out so quickly. I am a bit confused tho, your original PR made the switch from NextLine
to Down
- doesn't this change have the same effect as before?
@AlecAivazis My previous PR replaced all occurrences of function calls for PreviousLine()
and NextLine()
with Up()
and Down()
. For Linux terminals, the result is the same. However, an unforeseen effect of that was that is broke the lib for windows because on windows you need HorizontalAbsolute()
, which was not called anymore because of the replacement.
@System-Glitch - finally got my hands on a mac laptop. I will pull this down now and give it a shot
@AlecAivazis I got a friend of mine test it for me on mac and everything appears to be working correctly.
I was also able to confirm that the behavior is consistent across mac and windows. Thanks for being patient 👍
References:
300 #302 #307 #308
I think this change will be enough to make it work on both Windows and Linux. I have tested in cmd.exe on windows, and on Ubuntu Konsole and VSCode integrated terminal. I cannot test on MacOS though because I don't own a Mac.
Logic behind this change:
In
cursor_windows.go
,PreviousLine()
callsDown()
andHorizontalAbsolute()
, so I just did the same for linux but withoutHorizontalAbsolute()
because it is apparently not needed (Test it on MacOS and tell me if it works. If it doesn't, then I think adding a call toHorizontalAbsolute()
would do the trick). This allows us to keepPreviousLine()
andNextLine()
and don't have a conflict in naming between the windows and other versions.