* fix: guard rename/update_url actions against empty remote list
The rename_remote() and update_remote_url() event handlers in
RemoteListPopup did not check valid_selection() before indexing
into self.remote_names, causing a panic (index out of bounds)
when no remotes are configured.
The delete_remote() handler already had this guard. This commit
adds the same valid_selection() check to the other two handlers
for consistency.
Fixes#2868Fixes#2869
* chore: add changelog entry and sort Cargo.toml dependencies
* revert: restore original Cargo.toml formatting
* fix: disable blame and history popup for untracked files
An untracked file does not have any history data. Right now when
you press `B` for the blame popup or the `H` for the history popup
you get an empty popup where the title spins endlessly trying to find
the file in the commit history, and show relevant information.
This commit disables the two actions in the `StatusTreeComponent`, when the
selected item is a file which is not tracked by git.
---------
Co-authored-by: extrawurst <mail@rusticorn.com>
* Update gix from 0.71.0 to 0.74.1
* Bump MSRC from 1.81 to 1.82
This is required by `gitoxide` 0.74.
* Address clippy issues
* Add getrandom and rustix to deny.toml
* Document reasons for ignoring duplicates
Same as in 1d2248571d for the config
directory, when the cache directory fails to get created for whichever
reason, we currently exit gitui with a pretty undescriptive error.
Improves on #2684.
Fixes#2652.
ratatui::Terminal starts by hiding the cursor. If we panic and abort,
that Terminal instance is not dropped, which leaves restoring the cursor
state to us.
Co-authored-by: Naseschwarz <naseschwarz@0x53a.de>
The algorithm for computing marked_consecutive assumes that commits are
consecutive in the commit graph if they are consecutive in the
linearized log used in` commitlist.rs`. That is not universally correct,
as siblings may also be displayed consecutively in this list.
For now, this just removes generating commit lists in dotted range
notation.
Co-authored-by: Naseschwarz <naseschwarz@0x53a.de>
* Copy text using OSC52 if X/Wayland methods fail
* Move Wayland/X string copying out of copy_string
Copying logic seems too nested to comprehend with the introcution of two
paths towards OSC52 otherwise.
---------
Co-authored-by: Naseschwarz <naseschwarz@0x53a.de>
Co-authored-by: extrawurst <776816+extrawurst@users.noreply.github.com>
* Improve syntax detection
Currently, gitui prioritizes file extensions for syntax detection.
When a file lacks an extension (e.g. Makefile), or the extension
isn't tied to a specific format (e.g. .lock), it disables syntax
highlighting. Gitui will now try to detect the syntax from the entire
filename and the first line of the file using find_syntax_for_file().
---------
Co-authored-by: extrawurst <mail@rusticorn.com>