Commit graph

194 commits

Author SHA1 Message Date
Jesse Duffield 01ea5813a8 align Gui struct with GitCommand 2022-01-04 09:07:15 +11:00
Jesse Duffield 37be9dbea1 support scrolling left and right 2021-11-05 07:58:21 +11:00
Jesse Duffield 802cfb1a04 render commit graph 2021-11-05 07:58:21 +11:00
Jesse Duffield 2fc1498517 some refactoring in anticipation of the graph feature 2021-11-01 10:03:49 +11:00
Sam Burville f6e316dfe5 Improve JumpToBlock keybinding functionality
Improve experience when yaml file has != 5 keybindings and change view
helper to use the length of the array instead of hardcoded value.
2021-10-22 22:38:26 +11:00
Sam Burville 91e8765d9c Add JumpToBlock keybinding
This should allow users to decide their own keybinding for jumping
between blocks/panels.
E.g. A user could choose 5-9 instead of 1-5.
2021-10-22 22:38:26 +11:00
Jesse Duffield e7c27b6f4a small fixes 2021-10-17 06:41:21 +00:00
Jesse Duffield 345c90ac05 fix editor 2021-10-17 04:17:59 +00:00
Cristian Betivu 39c8577074 Use static context 2021-06-16 15:00:17 +10:00
Cristian Betivu 0c2d90a444 Add comment 2021-06-16 15:00:17 +10:00
Cristian Betivu 0c135515a5 Use parent view for tab navigation 2021-06-16 15:00:17 +10:00
Jesse Duffield a9fbc9eda1 fix merge conflict panel not rendering 2021-04-11 10:21:53 +10:00
Jesse Duffield 39ae122304 more refactoring 2021-04-06 19:34:32 +10:00
Jesse Duffield 4fe512ff3a test
type safe view access
2021-04-06 19:34:32 +10:00
Jesse Duffield f3a0058eb9 WIP 2021-04-06 19:34:32 +10:00
Jesse Duffield fafd5234bd refactor to get view tab context map into gui state 2021-04-06 19:34:32 +10:00
Jesse Duffield ae0f750770 fix bug where you couldn't change tabs 2021-04-06 19:34:32 +10:00
Jesse Duffield 798d3e2d54 get rid of these positively ghastly method signatures 2021-04-06 19:34:32 +10:00
Jesse Duffield 7d62f103e4 big refactor to give our enums actual types 2021-04-02 11:00:15 +11:00
Jesse Duffield 8dee06f83a allow toggling tree view for commit files panel 2021-04-02 11:00:15 +11:00
Jesse Duffield da3b0bf7c8 Start on supporting auto-suggestions when checking out a branch
switch to other fuzzy package with no dependencies
2020-11-28 20:48:17 +11:00
Jesse Duffield 682db77401 fix lint errors 2020-11-18 08:36:19 +11:00
Jesse Duffield 4c9ec88be5 fix mutex deadlock 2020-10-10 00:23:01 +11:00
Jesse Duffield 79e59d5460 add some safe goroutines
WIP
2020-10-10 00:23:01 +11:00
Jesse Duffield 2e05ac0c90 paging keybindings for line by line panel
support searching in line by line panel

move mutexes into their own struct

add line by line panel mutex

apply LBL panel mutex

bump gocui to prevent crashing when search item count decreases
2020-10-10 00:23:01 +11:00
Jesse Duffield 37bb89dac3 type i18n 2020-10-10 00:23:01 +11:00
Jesse Duffield 4912205adb remove viper
WIP
2020-10-10 00:23:01 +11:00
Jesse Duffield 7b4a0f20b2 add submodules context 2020-10-02 08:09:42 +10:00
Jesse Duffield 077f113618 add in-built logging support for a better dev experience 2020-09-26 11:00:50 +10:00
Jesse Duffield fda9f4ea7a centralise logic for rendering options map 2020-08-23 14:29:18 +10:00
Jesse Duffield eb5e54e9fd use interface for panel state rather than pointer 2020-08-23 14:29:18 +10:00
Jesse Duffield 2fac2f9f1f WIP 2020-08-23 14:29:18 +10:00
Jesse Duffield 2f5d5034db good progress 2020-08-23 14:29:18 +10:00
Jesse Duffield 9c866fd49c more standardisation 2020-08-23 14:29:18 +10:00
Jesse Duffield 3c87ff4eff WIP: standardising how we render to main 2020-08-23 14:29:18 +10:00
Jesse Duffield 0f7b2c45d7 centralise split main panel code 2020-08-23 14:29:18 +10:00
Jesse Duffield a12d18146c better logic for taking focus away from popup panels 2020-08-23 14:29:18 +10:00
Jesse Duffield ac0eedda91 lots more stuff 2020-08-23 14:29:18 +10:00
Jesse Duffield 7f89113245 WIP 2020-08-23 14:29:18 +10:00
Jesse Duffield c8add47fe7 move cursor to right when using auto prefix 2020-08-16 18:44:39 +10:00
Jesse Duffield 9b7a6934b3 more removing of g 2020-08-15 18:01:43 +10:00
Jesse Duffield 15229bbdab more removing of g and v 2020-08-15 18:01:43 +10:00
Jesse Duffield 63e6eea9ec files view 2020-08-15 18:01:43 +10:00
Jesse Duffield 50d5b9e8e7 status view 2020-08-15 18:01:43 +10:00
Jesse Duffield cc872b0444 menu view 2020-08-15 18:01:43 +10:00
Jesse Duffield 17b84e09c0 fix remote branches select sig 2020-08-15 18:01:43 +10:00
Jesse Duffield 43f8bae267 fix remotes select sig 2020-08-15 18:01:43 +10:00
Jesse Duffield b0fe963f8a fix branches select sig 2020-08-15 18:01:43 +10:00
Jesse Duffield d9fa02c53b clean up interface for popup panels 2020-08-15 18:01:43 +10:00
Jesse Duffield e73937c2bd more work on new layout functionality 2020-08-13 21:50:23 +10:00
Jesse Duffield b51ad4fcea softcode cyclable views 2020-08-13 21:50:23 +10:00
Jesse Duffield 771d4b5811 refactor how we handle layouts 2020-08-13 21:50:23 +10:00
Jesse Duffield 845c80721f Decouple escaping from quitting
When a user is not entering text into a prompt, the 'q' key should immediately
quit the application. On the other hand, the 'esc' key should cancel/close/go-back
to the previous context.

If we're at the surface level (nothing to cancel/close) and the user hits the
escape key, the default behaviour is to close the app, however we now have a
`quitOnTopLevelReturn` config key to override this.

I actually think from the beginning we should have made this config option
default to false rather than true which is the default this PR gives it,
but I don't want to anger too many people familiar with the existing behaviour.
2020-07-18 20:00:48 +10:00
Jesse Duffield 36ac764133 fix race condition when scrolling to merge conflict 2020-05-19 18:05:14 +10:00
Jesse Duffield 9eb1cbc514 reset main's origin when cycling views 2020-03-29 02:36:01 +00:00
Jesse Duffield a8db672ffb refactor gui.go 2020-03-29 11:37:29 +11:00
Jesse Duffield 7876cddf4a remove dead code 2020-03-28 11:59:45 +11:00
Jesse Duffield 29316a528a better documentation 2020-03-28 11:59:45 +11:00
Jesse Duffield f7add8d788 smarter refreshing for tags and remotes 2020-03-28 11:59:45 +11:00
Jesse Duffield 906a49049e smart refreshing files 2020-03-28 11:59:45 +11:00
Jesse Duffield 61b4bbf74e clean up signature 2020-03-28 11:59:45 +11:00
Jesse Duffield 198d237679 more centralised handling of refreshing 2020-03-28 11:59:45 +11:00
Jesse Duffield 39315ca1e2 use wait groups when refreshing 2020-03-28 11:59:45 +11:00
Jesse Duffield efb51eee96 more efficient refreshing 2020-03-28 11:59:45 +11:00
Jesse Duffield fbbd16bd82 use reflogs from state to work out branch recencies 2020-03-28 11:59:45 +11:00
Jesse Duffield e47ad846c4 big golangci-lint cleanup 2020-03-09 12:23:13 +11:00
Jesse Duffield f94d0be2c9 refactor the way we render lists 2020-02-25 21:21:07 +11:00
Jesse Duffield 9fd9fd6816 better commit lines in fullscreen mode 2020-02-25 21:21:07 +11:00
Jesse Duffield 46be280c92 support searching in side panels
For now we're just doing side panels, because it will take more work
to support this in the various main panel contexts
2020-02-24 22:18:04 +11:00
Jesse Duffield dab78c8a63 stop the files panel from stealing focus whenever files are refreshed 2019-12-08 21:27:28 +11:00
Jesse Duffield 3c13229145 add tags panel 2019-11-21 22:07:14 +11:00
Jesse Duffield 3b0cef2ec8 better handling of click events in list views 2019-11-21 22:07:14 +11:00
Jesse Duffield 986abc1e45 support viewing a remote branch 2019-11-21 22:07:14 +11:00
Jesse Duffield 61dac10bb9 support navigating remotes view 2019-11-21 22:07:14 +11:00
Jesse Duffield 8aa1062e06 extract out some logic for list views 2019-11-21 22:07:14 +11:00
Jesse Duffield 7e0a8f235e add contexts to views 2019-11-21 22:07:14 +11:00
Jesse Duffield 131113b065 simplify how the context system works 2019-11-10 22:32:13 +11:00
Jesse Duffield e85310c0a9 add mouse support 2019-11-10 22:32:13 +11:00
Jesse Duffield 1a38bfb76d do not return focus to commitsFiles view after selecting to start a new patch 2019-11-05 19:22:01 +11:00
Jesse Duffield d5e443e8e3 Support building and moving patches
WIP
2019-11-05 19:22:01 +11:00
Jesse Duffield 820f3d5cbb support split view in staging panel and staging ranges 2019-11-05 19:22:01 +11:00
Giorgio Previtera a1c6619401 \#480 Close popup panels before switching to a side view
Reusing the `onNewPopupPanel` function to close existing popup panels
(if any) before switching to a new side view. Alse closing any
confirmation prompt.
2019-10-27 12:39:08 +11:00
Giorgio Previtera 3524f6baa9 480 - remove duplication by using a decorator
Also use a for loop to append the new keybindings
2019-10-27 12:39:08 +11:00
Giorgio Previtera ac5cbc1d2c #480 Allow cycling side panels with number keys 2019-10-27 12:39:08 +11:00
mjarkk 6ba05c94ea Added another resizing step 2019-04-25 21:37:19 +02:00
Jesse Duffield d84dfc23e7 Rely on model rather than view to focus a point
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-03-23 11:54:25 +11:00
Jesse Duffield 3b2353b5ae remove redundant call to refreshCommitFilesView
We already call this function inside the refreshCommitsView function.
We call it there because it's logical that A) one occurs whenever the other does and
B) the commit files only get refreshed after we've updated the commits themselves
2019-03-16 10:20:27 +11:00
Jesse Duffield 4f7f6a073c allow user to discard old file changes for a given commit 2019-03-16 10:20:27 +11:00
Jesse Duffield 1ad9c6faac minor cleanup 2019-03-16 10:20:27 +11:00
skanehira 06fe726ee7 Add feature of display committed file list #383 2019-03-16 10:20:27 +11:00
Jesse Duffield Duffield 8c0ea8f45f mouse support 2019-03-02 17:49:30 +11:00
Jesse Duffield e011e9bc42 more work on rebasing feature 2019-02-16 21:01:17 +11:00
Jesse Duffield ad93b4c863 consider whether the view has focus when rendering the contents of a view 2019-02-16 15:17:44 +11:00
Jesse Duffield 198cbee498 introduce panel contexts and more work on rebasing 2019-02-16 12:07:27 +11:00
Jesse Duffield 3d343e9b57 Merge branch 'master' into feature/rebasing 2019-02-11 21:02:53 +11:00
Jesse Duffield 3a607061a2 Only reset origin in main view when handling the selection of a new file 2019-01-18 09:32:15 +11:00
Jesse Duffield 695b092c41 Directly send wrap argument rather than the view 2019-01-17 10:29:52 +11:00
Jesse Duffield 865c7c2332 minor refactor of credentials panel into its own file 2018-12-18 22:19:32 +11:00
Jesse Duffield 4886b8350e always hide rather than delete the credentials view, and don't log on error in case there is a user password in the error 2018-12-16 17:28:04 +11:00
mjarkk 5d038dfd33 Removed the wired error handling 2018-12-12 22:11:31 +01:00