summaryrefslogtreecommitdiffstats
path: root/src/process/mod.rs
AgeCommit message (Collapse)Author
2021-01-27Rewrite display and input to use CrosstermTim Oram
The project has pushed the limits of what curses can support on Windows systems. Crossterm has far superior support for creating cross platform TUI applications.
2021-01-27Return result in displayTim Oram
2021-01-27Add mutable to cursesTim Oram
2021-01-27Add Size struct and refactorTim Oram
2020-11-23Add tests for process moduleTim Oram
2020-11-23Add support for Exit key and abortTim Oram
Add Exit key input support and allow it to trigger an application abort.
2020-10-29Move git interactive to todo file moduleTim Oram
The GitInteractive stuct is one of the oldest structs in the project and was initially used as a catch-all for any functionality that was shared across the application. Overtime the functionality of this file has been moved into the various modules of the project. At this point, the only thing the struct handles is the direct interactions with the rebase todo file and it's lines. This finally moves the global stuct into a module.
2020-10-25Remove process function from process moduleTim Oram
The process function from the process module was only being used in the external editor system. The usage in the external editor system was only used as a faux on activate hook. Since the existing activate function can instead be used to perform the same action, the process function can be removed. This change removes the last usage of the process function and then completely removes the usage of the process function from the project.
2020-10-01Convert activate to use ProcessResultTim Oram
The way that Result was used to handle errors in activate does not allow an error to return the user to another state. This converts the activate function to use ProcessResult that supports error results and state change.
2020-09-25Greatly improve input handling and missing keysTim Oram
This greatly improves the handling of keyboard input by ensuring that all Pancurses inputs are properly accounted for. This resulted in several missing keys being added. Also, provide a standard function for handling the scrolling of view data and add scrolling support to the error display. Also add End and Home support to the edit module.
2020-09-23Use anyhow in ExternalEditorTim Oram
This replaces the final usages of String errors in the project. This required a significant amount of rework in the process testutils, as the anyhow Error is now used in the ProcessResult struct instead of a String.
2020-09-21Use anyhow in the process moduleTim Oram
Replace the String errors in the process module with the anyhow library.
2020-09-21Use anyhow in process module traitTim Oram
Update the activate function in the process module trait to use anyhow for error handling and update any usages of the error to use the new error type.
2020-09-21Use anyhow in the main application structTim Oram
The main application struct uses String errors, which make it difficult to provide context on errors. This updates the struct to provide errors with anyhow and fixes any references that used to depend on the String errors. While working on the code, several poor usages of match have been replaced with `map_or*`, `unwrap_or*` chains.
2020-09-21Fix formatting error in process moduleTim Oram
2020-09-20Refactor and test external editorTim Oram
The external editor module has not seen any attention in some time and was showing some warts. This refactors the module to remove some dead code and unneeded complexity. This allowed for the error process result to be simplified, view to not be provided to the process function and for two of the internal states to be removed/combined. Tests have also been added to ensure that the module works as expected.
2020-09-19DRY up process moduleTim Oram
The process module has always been fairly repetitive and adding a new module required updates to several places in the file. This change refactors the process module to use dynamic dispatch to call the functions on the ProcessModule trait dynamically. This required the error, help and window size error systems to be modified to implement the ProcessModule. The show commit module has been refactored to use the error module. And the state and modules have been extracted into their own Modules struct.
2020-09-18Move window size error into process moduleTim Oram
The window size error never really worked as a separate module, so this change moves that functionality into the process module.
2020-09-17Move error handling to process moduleTim Oram
The error handling module needed to have state provided to it from other modules, which meant that the other modules needed to understand how the error module worked. This was awkward and fragile. This moves the error handling code into the process module and makes it a global system. This has the advantage of not requiring tracking of the previous state and allows for the removal of the HandleInputResult struct.
2020-09-17Fix some reference/bindings to be more clearTim Oram
2020-09-14Refactor data render testsTim Oram
The render tests for the confirm abort/rebase modules required too much knowledge of how the Curses interface rendered data. This resulted in fragile tests that would break if the underlying curses interface changed. This updates those tests to instead test against a test render output that has no dependency on Curses.
2020-09-02Refactor help to not be a process moduleTim Oram
The help process module always needed to have knowledge of the different modules in the project, which was very awkward. This updates the help system to be part of the process module and moves the help data into the modules. This also allowed the removal of the visual boolean on the List state, that was only used when rendering the help module.
2020-09-01Remove RefCell for state in Process moduleTim Oram
The RefCell in the Process module was no longer needed, so remove it.
2020-09-01Cleanup the render stage in the Process moduleTim Oram
This reworks the interaction between the Process and View module.
2020-08-21Refactor Edit module to use ViewDataTim Oram
The Edit module is the final module that is not using the ViewData. This adds a raw content value to the ViewData that will generated wrapped content lines. The Edit module uses this new functionality to remove the raw renders from the module.
2020-08-02Refactor Exiting module to use ViewDataTim Oram
This changes the Exiting module to use the ViewData struct over a raw render call.
2020-08-02Move Window Size Error module to use ViewDataTim Oram
This updates the Window Size Error module to use the ViewData struct over a direct view render.
2020-08-02Rewrite Error module to use ViewDataTim Oram
The Error module was manually rendering the view with a render function. This change converts the module to use the ViewData struct and remove the need for a custom render function.
2020-08-02Move prompt to ViewDataTim Oram
The confirm prompts were still using the raw view render function. This adds support for prompts for the ViewData and draw_view_data functions and updates the usage of the prompts to use the ViewData struct instead.
2020-07-29Remove several unneeded borrowsTim Oram
There were several places that borrows were occurring on values that did not require another borrow. This removes the extra unneeded borrows.
2020-07-29Remove most usages of pub(crate)Tim Oram
I was overzealous in my application of `pub(crate)` in a project that does not provide an external library. This removes most of the usages of `pub(crate)`, though I am sure there are more that could be safely converted to use `pub`.
2020-07-06Improve show commit moduleTim Oram
This change refactors and improves the show commit module. This change added: - key bindings/help displayed on the last line - list of number of files changed as well as the number of additions and deletions - git configuration for renames, rename_limit and copies now respected - full help page This change refactored: - input handling to be specific to the show commit module - rewritten how git diff information is queried from the git2-rs bindings - new ViewDataBuilder struct for building the view lines
2020-06-28Refactor git values in configurationTim Oram
This updates the configuration to add a `GitConfig` struct that contains the configuration values from git.
2020-06-21Refactor key bindings/input configurationTim Oram
This change changes the input configuration to nest the inputs under a new struct called `key_bindings`. This new struct is now injected in place of the full configuration object where possible.
2020-06-20Inject external editor value over configTim Oram
The full configuration object is passed to the external editor module when only the external editor value is used. This change injects the editor value instead of the full configuration instance.
2020-06-07Rewrite the view text rendering systemTim Oram
This updates the view text rendering system to render data based on a data structure instead of having each module have to manually render the required text. The new data structure is based on the data struct that was created for the show_commit module, but has been expanded to provide additional functionality and performance benefits. The new rendering system has been implemented for the help, list and show_commit modules. Additionally tests have been added to the view module to ensure that this new functionality performs as expected.
2019-12-28Update visibility to be required minimumTim Oram
This change updates the usages of `pub` to be the minimum level of visibility needed. This also required cleaning up some of the use statements to use a simpler set of imports.
2019-06-04Move process loop out of applicationTim Oram
2019-06-01Add HandleInputResultTim Oram
2019-05-31Add ProcessResultTim Oram
2019-05-26Move state out of applicationTim Oram