Commit graph

194 commits

Author SHA1 Message Date
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
Jesse Duffield a26c15dafa some fixes for issues around the credentials panel 2018-12-12 22:34:20 +11:00
Jesse Duffield 9489a94473 Make merge panel its own panel 2018-12-11 22:02:12 +11:00
mjarkk 50f20de8f3 Removed a lot of duplicated code 2018-12-10 08:22:52 +01:00
mjarkk 61c2778de1 Changed pushPassUname name to credentials 2018-12-10 07:51:06 +01:00
Mark Kopenga 19a6a32625
Merge branch 'master' into https-ask-for-username-password 2018-12-08 16:41:39 +01:00
Jesse Duffield ff856b7630 fetching branches without checking out 2018-12-08 11:51:47 +11:00
Jesse Duffield ca3afa2a39 standardising how list panels deal with cursor movement 2018-12-08 11:51:47 +11:00
Jesse Duffield 99a8b1ae8b making a start on unidirectional data binding to fix these UI bugs 2018-12-08 11:51:47 +11:00
Mark Kopenga 1b6d34e76a
Merge branch 'master' into https-ask-for-username-password 2018-12-06 08:31:12 +01:00
Jesse Duffield c0f9795910 staging lines and hunks 2018-12-05 19:33:46 +11:00
Jesse Duffield 658e5a9faf initial support for staging individual lines 2018-12-04 22:11:48 +11:00
mjarkk 32ecc6d745 Removed getPushPassUnameView function 2018-11-10 09:09:18 +01:00
mjarkk 12425f0aa7 First good success 2018-10-20 17:37:55 +02:00
Jesse Duffield 7947668e18 Merge branch 'hotfix/273-cursor-scrolling' of https://github.com/jesseduffield/lazygit into hotfix/273-cursor-scrolling 2018-09-22 13:50:01 +10:00
Jesse Duffield 619c28ce56 use lineheight rather than buffer length 2018-09-22 13:49:58 +10:00
Jesse Duffield b9708c9f88 fix issues with commit message panel losing focus 2018-09-19 20:36:40 +10:00
Jesse Duffield 52b132fe01 better handling of cursor and origin positionings 2018-09-10 20:17:39 +10:00
Dawid Dziurla 6f7de83bce
Merge branch 'master' into feature/help
conflicts resolved
2018-09-09 10:41:01 +02:00
Dawid Dziurla 557009e660
help -> menu 2018-09-05 11:12:11 +02:00
Jesse Duffield 422b263df4 fix popup panel resizing 2018-09-05 19:10:46 +10:00
Dawid Dziurla 67d99a24ea
get selected branch from correct panel 2018-09-03 18:45:52 +02:00
Dawid Dziurla 28a9594ef7
update help panel
- delete scrolling ability
- lines are now selectable
- implemented handler execution when space is pressed
- add example descriptions for status panel keybindings
2018-09-03 17:52:05 +02:00
Dawid Dziurla 2416f585ce
initial help panel 2018-09-03 17:52:05 +02:00
Jesse Duffield 21f6e9ba87 auto-updates 2018-08-25 17:32:34 +10:00
Jesse Duffield f24c95aede Merge branch 'master' into feature/auto-updates 2018-08-25 11:02:46 +10:00
Jesse Duffield 5628eae502 WIP 2018-08-23 18:43:16 +10:00
Tommy Nguyen e8b12a086c
Fix ineffectual assignment 2018-08-19 08:52:08 -04:00
Tommy Nguyen 766197de9d
NormalizeLinefeeds removes rather than converts Window/Mac style lf's 2018-08-19 08:48:03 -04:00
Tommy Nguyen cea736e6e9
Factor out into NormalizeLinefeeds; add tests 2018-08-19 07:20:50 -04:00
Tommy Nguyen b46d174f70
view_helpers.go: don't ignore return value 2018-08-19 02:21:33 -04:00
Tommy Nguyen cdc6d45fa4
view_helpers.go: replace \r with \r\n 2018-08-19 02:19:19 -04:00
remyabel 9a923eb300
Merge branch 'master' into 157_remove_bom 2018-08-18 02:11:13 -04:00
Jesse Duffield a1a828a781 support opening and editing config file 2018-08-18 14:54:05 +10:00
remyabel 64d8a55dbd
Merge branch 'master' into 157_remove_bom 2018-08-16 07:59:31 -04:00
Tommy Nguyen 74d81ae080 [rebase] Fix errors; update dependencies
Argument must be []byte not string

Don't commit bomtest.txt
2018-08-16 07:17:47 -04:00
Mark Kopenga faf218f465 Fixed comments from jesseduffield on issue #137 2018-08-16 11:31:50 +02:00
Tommy Nguyen f09515867d #157: clean BOM, allowing CSV files to display correctly 2018-08-16 01:53:53 -04:00
Mark Kopenga 88e1a815fe Fixed comment on issue #137 from @jesseduffield 2018-08-16 07:16:32 +02:00
Mark Kopenga 50b41bfccc Translated pkg/gui/view_helpers.go 2018-08-15 11:49:43 +02:00
Mark Kopenga dfafb98871 tried to update to latest master 2018-08-14 11:05:26 +02:00
Jesse Duffield fb0004481b correct cursor before returning item position 2018-08-13 21:42:56 +10:00
Jesse Duffield 9e725ae24e got this bad boy compiling again 2018-08-13 21:16:21 +10:00
Jesse Duffield 97cff65612 progress on refactor 2018-08-13 20:26:02 +10:00
Andrei Miulescu dcd461d29f
Restrucure project in a way where it is more modular 2018-08-12 19:31:27 +10:00
Renamed from view_helpers.go (Browse further)