summaryrefslogtreecommitdiffstats
path: root/src/context
AgeCommit message (Collapse)Author
2022-09-05move border rendering out of folder viewJeff Zhao
2022-08-31rework previews to have loading state as wellJeff Zhao
2022-08-31use hashmap and uuid to store tabs (#194)Jeff Zhao
This is preliminary changes in order to track preview threads and progress. The current setup is we just kick off a new thread to load the given directory whenever we see the directory content does not exist in history. We don't track these threads or which tab these requests came from. When the result is returned, we just assign it to the current tab, instead of the tab that actually initiated the request. By adding uuid, we can now track which tab requested the preview and assign it accordingly. This will also allow us to track the status of the preview, so we can display to the user a loading state, when a directory is taking longer than usual to load. This will also solve the problem of kicking off multiple threads to read the same directory for the same tab. Now these threads can be stored and tracked. - side: fix reload not honouring tab sort options - use tab specific options whenever we need to reload stuff
2022-08-30Add "Visual-Mode" (#192)DLFW
* Add "Visual-Mode" This adds a "visual-mode" file selection feature where a range-selection follows the file-cursor. Description of usage is added to the docs. Also, the "normal" and the new "visual-mode-selection" are now preserved when a `DirList` is reloaded. Wrap-up of changes: * Add command `toggle_visual`, mapped to `V` * Add command `escape`, mapped to `ESCAPE` * Add style `[visual_mode_selection]` for file entries which are "temporarily" selected by visual-mode * For `JoshutoDirEntry`, the attribute `selected` has been renamed to `permanent_selected`, and a second selection-attribute `visual_mode_selected` has been added. "Setters" and "getters" have been adapted/added accordingly. The former "getter" for the `selecetd` attribute still exists and returns `True` for an entry which is "permanant selected" _or_ "visual-mode selected". So any higher logic which acts on selected files does not need to care about "how" and entry is selected. * Each `JoshutoDirList` has an optional index of the file where visual-mode has been entered and re-calculates the "visual-mode selecetd" status for each entry any time the cursor-index changes. * The footer has been extended so it shows a "VIS" marker when the user is in visual-mode. This implementation of visual-mode is a bit different from the ranger one, where the visual-selection is turned into a "normal selection" when a command (like `copy-files`) is issued. This implementation keeps both selections separate until the user toggles back to "normal mode". Only then the visual-selection is taken over to the "normal selection". The user also can withdraw the visual-selection with `escape`. The `escape` command may be used also for other "reset"-actions in the future. * fix syntax for Rust stable * cargo clippy
2022-07-18asynchronize delete operationJeff Zhao
2022-05-04move input.rs to process_event.rsJeff Zhao
2022-04-22combine --output-dir and --choosefiles into a single argumentJeff Zhao
--output-file is used for all output by joshuto and can be specified what to output by: `quit --output-current-directory` `quit --output-selected-files`
2022-04-17code cleanupJeff Zhao
2022-04-17track child processes and properly close them when completeJeff Zhao
2022-04-14Use notify::RecommendedWatcher to simplify code and support BSD platforms (#165)unrelentingtech
Along with https://github.com/notify-rs/notify/pull/399 this fixes build on FreeBSD.
2022-02-24Fix clippy warnings (#144)sushi-shi
2022-02-01code cleanup (#135)DLFW
* code cleanup Remove dead code and unused imports around preview features. * Remove unused config option [display]show_preview * Remove config option [preview]preview_images * Remove unused imports * Remove dead code and unused imports
2022-01-28Remove boilerplate (#136)otakubeam
Co-authored-by: Andrew Orazov <orazov.ae@phystech.edu>
2022-01-19fix: disarm spawn bomb (#128)DLFW
The preview-removed-hook was called in each main loop cycle if no preview area was shown and a removed-hook was configured.
2022-01-14Update external preview on geometry change (#126)DLFW
When the size of the preview area changes, the "preview shown hook" is called to give a chance to update the size and/or position of the preview image.
2022-01-13Calling preview removed hook when help page shown (#125)DLFW
* Calling preview removed hook when help page shown * Better function names and documentation * syntax fix
2022-01-03Continuous scrolling (#118)DLFW
* Continuous scrolling The scrolling behavior is changed from “paging” to a continuous scrolling. Joshuto keeps a buffer from the cursor to each end of the list, which is configured by `[display] scroll_offset`. If the terminal height is too small to keep the distance, the buffer is set to a value that assures that the cursor is at least as close to the end the user is scrolling towards as to the other end of the visible list. If the window is resized and the cursor jumps out of scope, the viewport is adjusted when changing the index next time. Possible improvements: * Issue a viewport update on terminal geometry change * When scrolling down to the bottom, don't allow an empty section beneath the last entry * Update documentation for scroll_offset * remove unused variable * keep viewport index when replacing dirlist * Don't keep copy of scroll_offset in JoshutoDirList * sanity: remove obsolete parameter
2021-12-16change vec to hashsetJeff Zhao
2021-12-16Update view on filesystem changes (#112)DLFW
* Update view on filesystem changes AppContext owns an INotifyWatcher, which watches the visible directories (max. three). The list of directories to watch is updated on every event. If a filesystem change is announced, a "soft-update" of the current view is issued. * Specific "watchers" for Linux and MacOS For supervision of filesystem changes, specific `notify::Watcher` implementations are used for Linux and MacOS. Builds will likely fail for other OSes as `notify::recommended_watcher` may return some specific watcher implementation but the code just expects a `NullWatcher`. * remove dead code
2021-12-04move more logic into process_non_interactiveJeff Zhao
2021-11-27add scrolling support to file previewJeff Zhao
2021-11-16Add choosefiles feature (#105)Cameron Eldridge
* Add choosefiles feature * Use new QuitType::ChooseFile for choosefiles exit path * Compute final selection better
2021-10-02add basic support for command historyJeff Zhao
- move worker processing into input.rs - change readline to read_and_execute
2021-09-26file previews no longer continuously spawn threads for existing previewsJeff Zhao
- file previews also honor max_preview_size option - removed unnecessary return from cursor_move - parent_cursor_move now works properly with preview loading - reloading now retain directory sizes
2021-09-04messages now have color supportJeff Zhao
2021-08-18add quit_to_cwd commandJeff Zhao
- this command lets users exit to the current directory more easily and more ergonomically
2021-06-23code cleanupJeff Zhao
- directory loading is also on separate thread now
2021-06-22rudimentary file preview supportJeff Zhao
- this currently has only been tested with text files - no line formatting is done yet - only prints the preview as a single line - folder previews can now be pushed onto a separate thread if needed
2021-06-21refactor previewing codeJeff Zhao
- event.rs is moved out of utils as its an integral part of the codebase - load_child.rs has been replaced with preview module - moved previewing logic inside run.rs instead of spreading it across multiple commands
2021-05-06move worker stuff to its own context structJeff Zhao
2021-05-06make clippy happyJeff Zhao
2021-05-01make index public attributeJeff Zhao
- remove unused code and add #[allow(dead_code)]
2021-05-01remove methodsJeff Zhao
2021-04-30rename traits and move structs aroundJeff Zhao
2021-04-29rename some structs that start with Joshuto to AppJeff Zhao
- reduce sharing global variables between modules
2021-04-29rework config structureJeff Zhao
- sort options is now nested under display options which holds a lot of previously general options - fix glob search not searching backwards
2021-04-25add back option to string search instead of always glob searchJeff Zhao
- search will be used for string search - search_glob will be used for glob search
2021-04-25add glob support to searchJeff Zhao
2021-04-16code cleanupJeff Zhao
2020-12-30add resize notification support and preliminary mouse supportJiayi Zhao
- currently scroll is hardmapped to cursor_up and cursor_down
2020-12-24fix cut/copy src not updating after pasteJiayi Zhao
2020-12-15add option to not collapse previewJiayi Zhao
- add methods to access config_t - add back home dir path shortening option
2020-12-14selected item now highlights entire row instead of just filenameJiayi Zhao
2020-12-13code cleanup and fix path not showing when too longJiayi Zhao
2020-12-11add a view for showing worker progressJiayi Zhao
2020-09-19Change command to use an enum instead of polymorphismJiayi Zhao
2020-09-04io operations now give more informationJiayi Zhao
2020-08-30make io worker msgs more friendly and informativeJiayi Zhao
2020-08-30rework and fix issuesJiayi Zhao
- fixed bug where io tasks would not run when user is in a textfield or prompt - fixed bug where cut doesn't work - rework structs to have private fields and public functions - move IOWorkerObserver into seperate file - move code from TuiView to TuiFolderView
2020-08-29big rework and dependency updateJiayi Zhao
- abstract JoshutoContext implementation behind functions - rework io workers in an attempt to fix a bug - update dependencies - remove JoshutoContextWorker