awesome-gocui / gocui

Minimalist Go package aimed at creating Console User Interfaces.
BSD 3-Clause "New" or "Revised" License
350 stars 39 forks source link

Make some helpers for views navigate #70

Open sinkevichmm opened 4 years ago

sinkevichmm commented 4 years ago

added functions BufferLinePosition, SetViewLineUp, SetViewLineDown and example.

glvr182 commented 4 years ago

Thanks for the pr! Ill test your code tomorrow, so far it looks good!

sinkevichmm commented 4 years ago

Thanks for the pr! Ill test your code tomorrow, so far it looks good!

Ok!)

glvr182 commented 4 years ago

Okay so i havent gotten around to it... I'm a bit busy right now so ill try to get around to it. Maybe @mjarkk can take a look at it

glvr182 commented 4 years ago

When i run your example, on [3] the cursor value changes, but the cursor does not move. Is this the intended behaviour?

sinkevichmm commented 4 years ago

When i run your example, on [3] the cursor value changes, but the cursor does not move. Is this the intended behaviour?

Yes, this is an example with a wrap line that allows you to correctly display in view "props". The cursor has moved to a new line in the view array, but it is on the same line in the buffer array.

glvr182 commented 4 years ago

I mean that would of course be the expected result, however I fear that the tools that rely on Gocui are now expecting it to work wrong and would be confused if suddenly it worked right


I have been less active in the dev world since I'm very busy with university right now, so replies can take longer than expected

aliakseiz commented 3 years ago

@sinkevichmm thank you for this PR. Your functions SetViewLineUp and SetViewLineDown helped me to make the scrolling work again, as it was in the forked gocui. awesome-gocui spoiled it completely.

@glvr182 any progress on the review?

glvr182 commented 3 years ago

Going to ask @mjarkk to take this