summaryrefslogtreecommitdiffstats
path: root/pkg/gui/options_menu_panel.go
AgeCommit message (Collapse)Author
2020-02-15remove old createMenu functionJesse Duffield
2020-02-15continue refactor of menu panelJesse Duffield
2020-01-07fixed keybinding display in merge_panel.goDavid Chen
2019-11-21add contexts to viewsJesse Duffield
2019-03-23Rely on model rather than view to focus a pointJesse Duffield
Currently when we want to focus a point on a view (i.e. highlight a line and ensure it's within the bounds of a view's box, we use the LinesHeight method on the view to work out how many lines in total there are. This is bad because for example if we come back from editing a file, the view will have no contents so LinesHeight == 0, but we might be trying to select line 10 because there are actual ten things we expect to be rendered already. This causes a crash when e.g. 10 is greater than the height of the view. So we need to pass in to our FocusPoint method the actual number of items we want to render, rather than having the method rely on the LinesHeight, so that the method knows to scroll a bit before setting the cursor's y position. Unfortunately this makes for some awkward code with our current setup. We don't have a good interface type on these state objects so we now need to explicitly obtain the len() of whatever array we're rendering. In the case of the menu panel this is even more awkward because the items list is just an interface{} and it's not easy to get the list of that, so now when we instantiate a menu we need to pass in the count of items as well. The better solution would be to define an interface with a getItems and getLength method and have all these item arrays become structs implementing the interface, but I am too lazy to do this right now :)
2019-02-16introduce panel contexts and more work on rebasingJesse Duffield
2019-02-11post-merge cleanupJesse Duffield
2019-02-11Merge branch 'master' into feature/rebasingJesse Duffield
2019-02-11use go-errors package to display stacktrace of errors that cause panicsJesse Duffield
2018-12-11Make merge panel its own panelJesse Duffield
2018-09-19add recent repos menu optionJesse Duffield
2018-09-18generalise popup menu panelJesse Duffield