summaryrefslogtreecommitdiffstats
path: root/pkg/utils
AgeCommit message (Collapse)Author
2024-03-17Rename FuzzySearch to FilterStringsStefan Haller
It isn't necessarily fuzzy any more.
2024-03-17Default to substring filtering, add option to go back to fuzzy filteringStefan Haller
By default we now search for substrings; you can search for multiple substrings by separating them with spaces. Add a config option gui.filterMode that can be set to 'fuzzy' to switch back to the previous behavior.
2024-03-17Don't sort the results of fuzzy.FindStefan Haller
It sorts them already, so it's unnecessary. In the next commit we use this same code for substring searching too, and in that case we don't want to sort because sorting is by Score, but we don't even fill in the score for substring searching.
2024-03-16Allow deleting update-ref todosStefan Haller
2024-03-16Extract a findTodo helper functionStefan Haller
We will reuse it in the next commit.
2024-03-16Allow moving update-ref todos up/downStefan Haller
2024-03-16Refactor: pass Todo to moveTodoUp/Down instead of Sha and ActionStefan Haller
We need this because we want to enable moving update-ref todos, which don't have a sha.
2024-01-26Rename MinMax to SortRangeStefan Haller
2024-01-25Support range select for staging/discarding filesJesse Duffield
As part of this, you must now press enter on a merge conflict file to focus the merge view; you can no longer press space and if you do it will raise an error.
2024-01-23Support range select in rebase actionsJesse Duffield
2024-01-19Add range selection ability on list contextsJesse Duffield
This adds range select ability in two ways: 1) Sticky: like what we already have with the staging view i.e. press v then use arrow keys 2) Non-sticky: where you just use shift+up/down to expand the range The state machine works like this: (no range, press 'v') -> sticky range (no range, press arrow) -> no range (no range, press shift+arrow) -> nonsticky range (sticky range, press 'v') -> no range (sticky range, press arrow) -> sticky range (sticky range, press shift+arrow) -> nonsticky range (nonsticky range, press 'v') -> no range (nonsticky range, press arrow) -> no range (nonsticky range, press shift+arrow) -> nonsticky range
2023-10-16Pass "now" into utils.LoaderStefan Haller
This makes it possible to write deterministic tests for views that use it.
2023-09-20Add constant for LoaderAnimationIntervalStefan Haller
Since Loader and renderAppStatus need to agree on it, it helps for it to be a constant in case we want to change it.
2023-09-20Add history for search view (#2877)Jesse Duffield
2023-09-20Add search historyKarim Khaleel
Add search history for filterable and searchable views.
2023-09-04Add AppState to common.CommonStefan Haller
2023-08-28Make columnPositions include entries for removed columnsStefan Haller
We will pass these positions back to clients for rendering non-model items, and it's important that clients can consistently rely on them no matter which columns were removed.
2023-08-28Make RenderDisplayStrings return the column positionsStefan Haller
Not used by anything yet, but we'll need it later in this branch.
2023-08-28Take removed columns into account when applying column alignmentsStefan Haller
2023-08-28Add failing test demonstrating bug with column alignments and removed columnsStefan Haller
When columns to the left of a column with an alignment are removed, the alignment applies to the wrong column. We'll fix this in the next commit.
2023-08-28Change RenderDisplayStrings to return a slice of stringsStefan Haller
We'll join them with newlines afterwards. This will make it easier to insert other (non-model) items.
2023-08-28Cleanup: use slices.Delete to delete elements from a sliceStefan Haller
I find this much easier to read.
2023-08-19Fix arg order to assertsCristian Betivu
2023-07-30Standardise on using lo for slice functionsJesse Duffield
We've been sometimes using lo and sometimes using my slices package, and we need to pick one for consistency. Lo is more extensive and better maintained so we're going with that. My slices package was a superset of go's own slices package so in some places I've just used the official one (the methods were just wrappers anyway). I've also moved the remaining methods into the utils package.
2023-07-30Write unit tests with the help of aferoJesse Duffield
Afero is a package that lets you mock out a filesystem with an in-memory filesystem. It allows us to easily create the files required for a given test without worrying about a cleanup step or different tests tripping on eachother when run in parallel. Later on I'll standardise on using afero over the vanilla os package
2023-07-30Fix unit testsJesse Duffield
2023-07-30Better logic for knowing which repo we're inJesse Duffield
2023-07-30Use 'M' for months in branches panelJesse Duffield
2023-07-03View filtering (#2680)Jesse Duffield
2023-07-03Support case sensitive filteringJesse Duffield
2023-07-03Case insensitive string comparisonJesse Duffield
2023-07-03Introduce filtered list view modelJesse Duffield
We're going to start supporting filtering of list views
2023-07-02Use comment char config on interactive rebaseGustavo Krieger
Co-authored-by: Stefan Haller <stefan@haller-berlin.de>
2023-07-02Bump git-todo-parserGustavo Krieger
2023-06-26Avoid rewriting the file if nothing changedStefan Haller
This avoids changing the indentation or number of blank lines etc unnecessarily if nothing has changed.
2023-06-26Add new function RenameYamlKeyStefan Haller
2023-06-26Extract a lookupKey function that will be useful in the next commitStefan Haller
2023-06-26Create missing path elementsStefan Haller
This fixes a serious error: trying to change a value on gui.someOption would add a someOption key at root if gui doesn't exist.
2023-06-26Return an error if some node in the path is not a dictionaryStefan Haller
2023-06-26Return an error if node to be updated is not a scalarStefan Haller
2023-06-26Return an error if document is not a dictionaryStefan Haller
2023-06-26Support updating values in empty documentsStefan Haller
2023-06-26Rename UpdateYaml to UpdateYamlValueStefan Haller
We are going to add other ways to update yaml documents in the future.
2023-06-26Cleanup: improve test setup and check for the right error stringStefan Haller
Use the assert package to check expectations; also, check for the exact error message instead of just whether any error occurred.
2023-06-26Cleanup: remove unnecessary if statementsStefan Haller
The assert package is already very good at displaying errors, including printing a diff of expected and actual value, so there's no point in printing the same information again ourselves.
2023-06-01show commits against branchesJesse Duffield
2023-06-01update seconds ago function and add testsJesse Duffield
2023-05-26More compact and flexible date formatJesse Duffield
You can now configure both a time format and a short time format, where the short format kicks in when the time is within the last day
2023-05-21Right-align key labels in menuJesse Duffield
I find this makes it look a little nicer
2023-05-10add ability to update yaml path while preserving commentsJesse Duffield