146 Commits
Author SHA1 Message Date
Jesse Duffield d772c9f1d4 Use sentence case everywhere
We have not been good at consistent casing so far. Now we use 'Sentence case' everywhere. EVERYWHERE.

Also Removing 'Lc' prefix from i18n field names: the 'Lc' stood for lowercase but now that everything
is in 'Sentence case' there's no need for the distinction.

I've got a couple lower case things I've kept: namely, things that show up in parentheses.
2023-05-25 23:52:19 +10:00
Jesse Duffield 63dc07fded Construct arg vector manually rather than parse string
By constructing an arg vector manually, we no longer need to quote arguments

Mandate that args must be passed when building a command

Now you need to provide an args array when building a command.
There are a handful of places where we need to deal with a string,
such as with user-defined custom commands, and for those we now require
that at the callsite they use str.ToArgv to do that. I don't want
to provide a method out of the box for it because I want to discourage its
use.

For some reason we were invoking a command through a shell when amending a
commit, and I don't believe we needed to do that as there was nothing user-
supplied about the command. So I've switched to using a regular command out-
side the shell there
2023-05-23 19:49:19 +10:00
LukasandJesse Duffield 0606b7a43b remove empty message check as message of commit can be empty 2023-05-17 17:07:50 +10:00
Jesse Duffield 0cd5257523 Retain commit message when cycling history
When cycling history, we want to make it so that upon returning to the original prompt, you get your text back.
Importantly, we don't want to use the existing preservedMessage field for that because that's only for preserving
a NEW commit message, and we don't want the history stuff of the commit reword flow to overwrite that.
2023-04-30 12:17:34 +10:00
SeanandJesse Duffield 49da7b482d Split commit message panel into commit summary and commit description panel
When we use the one panel for the entire commit message, its tricky to have a keybinding both for adding a newline and submitting.
By having two panels: one for the summary line and one for the description, we allow for 'enter' to submit the message when done from the summary panel,
and 'enter' to add a newline when done from the description panel. Alt-enter, for those who can use that key combo, also works for submitting the message
from the description panel. For those who can't use that key combo, and don't want to remap the keybinding, they can hit tab to go back to the summary panel
and then 'enter' to submit the message.

We have some awkwardness in that both contexts (i.e. panels) need to appear and disappear in tandem and we don't have a great way of handling that concept,
so we just push both contexts one after the other, and likewise remove both contexts when we escape.
2023-04-30 12:17:34 +10:00
Stefan Haller 7513d77567 Add integration test for amending from the files panel 2023-04-01 08:16:15 +02:00
Jesse DuffieldandGitHub 4780953cef Merge pull request #2377 from shinhs0506/clear-staging-after-commit 2023-03-24 19:13:00 +11:00
John ShinandJesse Duffield 776d8f4d2e refresh the staging panel on successful commit
apply formatting
2023-03-20 20:13:59 +11:00
Jesse Duffield eabe7f462a migrate more tests 2023-02-22 21:57:32 +11:00
Jesse Duffield 0b55eaca1d add create tag from commit test 2023-02-20 19:01:08 +11:00
Jesse Duffield 9e2a3a87dd improved commit test 2023-02-20 18:20:23 +11:00
Jesse Duffield b5e325b0a4 migrate revert merge test 2023-02-19 15:48:09 +11:00
stk b499eba1a8 Select next stageable line correctly after staging a range of lines
We already have this very convenient behavior of jumping to the next stageable
line after staging something. However, while this worked well for staging
single lines or hunks, it didn't work correctly when staging a range of lines;
in this case we want to start searching from the first line of the range.
2023-02-15 21:29:00 +01:00
stk 97daec7228 Add test demonstrating selection bug when staging a range of lines
The selected line is not in the right position after staging a range of lines;
see next commit.
2023-02-15 21:28:05 +01:00
stk ff2a799200 Make SelectedLine/SelectedLineIdx work in staging/stagingSecondary views
While we try to keep the view's cursor position in sync with the context state's
selectedLineIdx (at least when pressing up or down), there are enough situations
where the two run out of sync; for example when initially opening the view, or
after staging a hunk, or when scrolling the view using the wheel. While it would
be possible to fix these situations to keep them always in sync, it doesn't seem
worth it, because the view's cursor position isn't really used for anything
else. So we rather special-case the SelectedLine/SelectedLineIdx functions of
ViewDriver to query the context state's selectedLineIdx directly if it is a
patch explorer context.
2023-02-15 21:22:11 +01:00
Jesse Duffield ae07cf5506 migrate discard old file change test 2022-12-28 13:01:32 +11:00
Jesse Duffield 9fef4447b6 move popup assertions into a struct 2022-12-28 11:00:22 +11:00
Jesse Duffield ed93e0a2b0 remove dependency on model 2022-12-27 22:52:20 +11:00
Jesse Duffield c5050ecabd move shell into test driver 2022-12-27 21:47:37 +11:00
Jesse Duffield 78b495f50a rename input to t 2022-12-27 21:35:36 +11:00
Jesse Duffield 53e06b71ae add tap function 2022-12-27 21:26:18 +11:00
Jesse Duffield b166b8f776 combine assert and input structs, clean up interface 2022-12-27 21:26:18 +11:00
Jesse Duffield 09e80e5f2a better namespacing for assertions 2022-12-27 21:26:18 +11:00
Jesse Duffield be30cbb375 add view asserter getter struct 2022-12-27 21:26:18 +11:00
Jesse Duffield b64f55518b refactor commit message stuff in integration tests 2022-12-27 21:26:18 +11:00
Jesse Duffield 8052ac4fd6 add prompt asserter 2022-12-27 21:26:18 +11:00
Jesse Duffield c976839a63 refactor prompt handling in integration tests 2022-12-27 21:26:17 +11:00
Jesse Duffield 09db4c4397 allow checking if line is selected in Lines and TopLines methods 2022-12-26 17:45:10 +11:00
Jesse Duffield 96310288ee allow chaining matchers 2022-12-26 17:15:33 +11:00
Jesse Duffield c841ba8237 add switch-to-view methods 2022-12-26 16:49:54 +11:00
Jesse Duffield 9a6f21ce42 cleaner test assertions 2022-12-26 12:20:13 +11:00
Jesse Duffield fa0414777f rename SelectedLine to CurrentLine in tests 2022-12-26 10:42:19 +11:00
Jesse Duffield 5d2584a188 introduce ViewLines functions 2022-12-25 11:38:00 +11:00
Jesse Duffield b623ecf898 add helper functions for popups in tests 2022-12-24 19:15:59 +11:00
Jesse Duffield aedfce2845 refactor to not have Match at the start of assert method names, because it reads better that way 2022-12-24 19:14:52 +11:00
Jesse Duffield bc4ace8357 add commit revert integration test 2022-12-20 22:45:02 +11:00
Jesse Duffield b40190bd94 add multi-line commit integration test 2022-12-20 22:45:02 +11:00
Arnaud PERALTAandJesse Duffield 50b0d85cd3 integration tests for commit without pre-commit hooks in staging files menu 2022-12-01 09:12:18 +11:00
Arnaud PERALTAandJesse Duffield bfcbf228bf commit integrations test with window name's assertion 2022-12-01 09:12:18 +11:00
Arnaud PERALTAandJesse Duffield 87e0f6b92d integration tests for commit in staged files and unstaged files menus 2022-12-01 09:12:18 +11:00
Jesse Duffield b2ae651686 add slow flag to integration tests 2022-08-14 20:49:20 +10:00
Jesse Duffield 53979f7cec a more complex custom command test 2022-08-14 20:49:20 +10:00
Jesse Duffield b8d9443999 rename helpers to components 2022-08-13 13:55:17 +10:00
Jesse Duffield 610eddfe05 fix CI 2022-08-13 13:55:09 +10:00
Jesse Duffield a45b22e12f re-name Input and improve documentation 2022-08-13 13:55:08 +10:00
Jesse Duffield ba96baee32 move code from main into app package to allow test to be injected 2022-08-13 13:55:08 +10:00