Skip to content

Commit 0e81f06

Browse files
author
Stephan Dilly
committed
fix slection error after deleting last element in stash (closes #223)
1 parent bb88c92 commit 0e81f06

File tree

2 files changed

+62
-19
lines changed

2 files changed

+62
-19
lines changed

Diff for: CHANGELOG.md

+60-19
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,33 @@
11
# Changelog
2+
23
All notable changes to this project will be documented in this file.
34

45
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
56
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
67

78
## [Unreleased]
89

10+
### Fixed
11+
12+
- selection error in stashlist when deleting last element ([#223](https://github.com/extrawurst/gitui/issues/223))
13+
914
## [0.9.1] - 2020-07-30
1015

1116
### Added
12-
- move to (un)staged when the current selection is empty [[@jonstodle](https://github.com/jonstodle)] ([#215](https://github.com/extrawurst/gitui/issues/215))
17+
18+
- move to (un)staged when the current selection is empty [[@jonstodle](https://github.com/jonstodle)](<[#215](https://github.com/extrawurst/gitui/issues/215)>)
1319
- pending load of a diff/status is visualized ([#160](https://github.com/extrawurst/gitui/issues/160))
1420
- entry on [git-scm.com](https://git-scm.com/downloads/guis) in the list of GUI tools [[@Vidar314](https://github.com/Vidar314)] (see [PR](https://github.com/git/git-scm.com/pull/1485))
15-
- commits can be tagged in revlog [[@cruessler](https://github.com/cruessler)] ([#103](https://github.com/extrawurst/gitui/issues/103))
21+
- commits can be tagged in revlog [[@cruessler](https://github.com/cruessler)](<[#103](https://github.com/extrawurst/gitui/issues/103)>)
1622

1723
![](assets/tagging.gif)
1824

1925
### Changed
26+
2027
- async fetching tags to improve reactivity in giant repos ([#170](https://github.com/extrawurst/gitui/issues/170))
2128

2229
### Fixed
30+
2331
- removed unmaintained dependency `spin` ([#172](https://github.com/extrawurst/gitui/issues/172))
2432
- opening relative paths in external editor may fail in subpaths ([#184](https://github.com/extrawurst/gitui/issues/184))
2533
- crashes in revlog with utf8 commit messages ([#188](https://github.com/extrawurst/gitui/issues/188))
@@ -34,10 +42,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3442
## [0.8.1] - 2020-07-07
3543

3644
### Added
37-
- open file in editor [[@jonstodle](https://github.com/jonstodle)] ([#166](https://github.com/extrawurst/gitui/issues/166))
45+
46+
- open file in editor [[@jonstodle](https://github.com/jonstodle)](<[#166](https://github.com/extrawurst/gitui/issues/166)>)
3847

3948
### Fixed
40-
- switch deprecated transitive dependency `net2`->`socket2` [in `crossterm`->`mio`] ([#66](https://github.com/extrawurst/gitui/issues/66))
49+
50+
- switch deprecated transitive dependency `net2`->`socket2` [in `crossterm`->`mio`](<[#66](https://github.com/extrawurst/gitui/issues/66)>)
4151
- crash diffing a stash that was created via cli ([#178](https://github.com/extrawurst/gitui/issues/178))
4252
- zero delta file size in diff of untracked binary file ([#171](https://github.com/extrawurst/gitui/issues/171))
4353
- newlines not visualized correctly in commit editor ([#169](https://github.com/extrawurst/gitui/issues/169))
@@ -47,48 +57,55 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4757
## [0.8.0] - 2020-07-06
4858

4959
### Added
50-
- core homebrew [formulae](https://formulae.brew.sh/formula/gitui#default): `brew install gitui` [[@vladimyr](https://github.com/vladimyr)] ([#137](https://github.com/extrawurst/gitui/issues/137))
60+
61+
- core homebrew [formulae](https://formulae.brew.sh/formula/gitui#default): `brew install gitui` [[@vladimyr](https://github.com/vladimyr)](<[#137](https://github.com/extrawurst/gitui/issues/137)>)
5162
- show file sizes and delta on binary diffs ([#141](https://github.com/extrawurst/gitui/issues/141))
5263

5364
![](assets/binary_diff.png)
54-
- external editor support for commit messages [[@jonstodle](https://github.com/jonstodle)] ([#46](https://github.com/extrawurst/gitui/issues/46))
65+
66+
- external editor support for commit messages [[@jonstodle](https://github.com/jonstodle)](<[#46](https://github.com/extrawurst/gitui/issues/46)>)
5567

5668
![](assets/vi_support.gif)
5769

5870
### Changed
71+
5972
- use terminal blue as default selection background ([#129](https://github.com/extrawurst/gitui/issues/129))
6073
- author column in revlog is now fixed width for better alignment ([#148](https://github.com/extrawurst/gitui/issues/148))
6174
- cleaner tab bar and background work indicating spinner:
6275

6376
![](assets/spinner.gif)
6477

6578
### Fixed
79+
6680
- clearer help headers ([#131](https://github.com/extrawurst/gitui/issues/131))
6781
- display non-utf8 commit messages at least partially ([#150](https://github.com/extrawurst/gitui/issues/150))
6882
- hooks ignored when running `gitui` in subfolder of workdir ([#151](https://github.com/extrawurst/gitui/issues/151))
69-
- better scrolling in file-trees [[@tisorlawan](https://github.com/tisorlawan)] ([#144](https://github.com/extrawurst/gitui/issues/144))
70-
- show untracked files in stash commit details [[@MCord](https://github.com/MCord)] ([#130](https://github.com/extrawurst/gitui/issues/130))
83+
- better scrolling in file-trees [[@tisorlawan](https://github.com/tisorlawan)](<[#144](https://github.com/extrawurst/gitui/issues/144)>)
84+
- show untracked files in stash commit details [[@MCord](https://github.com/MCord)](<[#130](https://github.com/extrawurst/gitui/issues/130)>)
7185
- in some repos looking up the branch name was a bottleneck ([#159](https://github.com/extrawurst/gitui/issues/159))
7286
- some optimizations in reflog
73-
- fix arrow utf8 encoding in help window [[@daober](https://github.com/daober)] ([#142](https://github.com/extrawurst/gitui/issues/142))
87+
- fix arrow utf8 encoding in help window [[@daober](https://github.com/daober)](<[#142](https://github.com/extrawurst/gitui/issues/142)>)
7488

7589
## [0.7.0] - 2020-06-15
7690

7791
### Added
92+
7893
- Inspect stash commit in detail ([#121](https://github.com/extrawurst/gitui/issues/121))
7994
- Support reset/revert individual hunks ([#11](https://github.com/extrawurst/gitui/issues/11))
8095
- Commit Amend (`ctrl+a`) when in commit popup ([#89](https://github.com/extrawurst/gitui/issues/89))
8196

8297
![](assets/amend.gif)
8398

8499
### Changed
100+
85101
- file trees: `arrow-right` on expanded folder moves down into folder
86102
- better scrolling in diff ([#52](https://github.com/extrawurst/gitui/issues/52))
87103
- display current branch in status/log ([#115](https://github.com/extrawurst/gitui/issues/115))
88-
- commit msg popup: add cursor and more controls (`arrow-left/right`, `delete` & `backspace`) [[@alistaircarscadden](https://github.com/alistaircarscadden)] ([#46](https://github.com/extrawurst/gitui/issues/46))
89-
- moved `theme.ron` from `XDG_CACHE_HOME` to `XDG_CONFIG_HOME` [[@jonstodle](https://github.com/jonstodle)] ([#98](https://github.com/extrawurst/gitui/issues/98))
104+
- commit msg popup: add cursor and more controls (`arrow-left/right`, `delete` & `backspace`) [[@alistaircarscadden](https://github.com/alistaircarscadden)](<[#46](https://github.com/extrawurst/gitui/issues/46)>)
105+
- moved `theme.ron` from `XDG_CACHE_HOME` to `XDG_CONFIG_HOME` [[@jonstodle](https://github.com/jonstodle)](<[#98](https://github.com/extrawurst/gitui/issues/98)>)
90106

91107
### Fixed
108+
92109
- reset file inside folder failed when running `gitui` in a subfolder too ([#118](https://github.com/extrawurst/gitui/issues/118))
93110
- selection could disappear into collapsed folder ([#120](https://github.com/extrawurst/gitui/issues/120))
94111
- `Files: loading` sometimes wrong ([#119](https://github.com/extrawurst/gitui/issues/119))
@@ -98,97 +115,121 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
98115
![](assets/commit-details.gif)
99116

100117
### Changed
118+
101119
- changed hotkeys for selecting stage/workdir (**Note:** use `[w]`/`[s]` to change between workdir and stage) and added hotkeys (`[1234]`) to switch to tabs directly ([#92](https://github.com/extrawurst/gitui/issues/92))
102120
- `arrow-up`/`down` on bottom/top of status file list switches focus ([#105](https://github.com/extrawurst/gitui/issues/105))
103121
- highlight tags in revlog better
104122

105123
### Added
124+
106125
- New `Stage all [a]`/`Unstage all [a]` in changes lists ([#82](https://github.com/extrawurst/gitui/issues/82))
107-
- add `-d`, `--directory` options to set working directory via program arg [[@alistaircarscadden](https://github.com/alistaircarscadden)] ([#73](https://github.com/extrawurst/gitui/issues/73))
126+
- add `-d`, `--directory` options to set working directory via program arg [[@alistaircarscadden](https://github.com/alistaircarscadden)](<[#73](https://github.com/extrawurst/gitui/issues/73)>)
108127
- commit detail view in revlog ([#80](https://github.com/extrawurst/gitui/issues/80))
109128

110129
### Fixed
130+
111131
- app closes when staging invalid file/path ([#108](https://github.com/extrawurst/gitui/issues/108))
112-
- `shift+tab` not working on windows [[@MCord](https://github.com/MCord)] ([#111](https://github.com/extrawurst/gitui/issues/111))
132+
- `shift+tab` not working on windows [[@MCord](https://github.com/MCord)](<[#111](https://github.com/extrawurst/gitui/issues/111)>)
113133

114134
## [0.5.0] - 2020-06-01
115135

116136
### Changed
137+
117138
- support more commands allowing optional multiline commandbar ([#83](https://github.com/extrawurst/gitui/issues/83))
118139

119140
![](assets/cmdbar.gif)
120141

121142
### Added
143+
122144
- support adding untracked file/folder to `.gitignore` ([#44](https://github.com/extrawurst/gitui/issues/44))
123145
- support reverse tabbing using shift+tab ([#92](https://github.com/extrawurst/gitui/issues/92))
124-
- switch to using cmd line args instead of `ENV` (`-l` for logging and `--version`) **please convert your GITUI_LOGGING usage** [[@shenek](https://github.com/shenek)] ([#88](https://github.com/extrawurst/gitui/issues/88))
125-
- added missing LICENSE.md files in sub-crates [[@ignatenkobrain](https://github.com/ignatenkobrain)] ([#94](https://github.com/extrawurst/gitui/pull/94))
146+
- switch to using cmd line args instead of `ENV` (`-l` for logging and `--version`) **please convert your GITUI_LOGGING usage** [[@shenek](https://github.com/shenek)](<[#88](https://github.com/extrawurst/gitui/issues/88)>)
147+
- added missing LICENSE.md files in sub-crates [[@ignatenkobrain](https://github.com/ignatenkobrain)](<[#94](https://github.com/extrawurst/gitui/pull/94)>)
126148

127149
### Fixed
150+
128151
- error when diffing huge files ([#96](https://github.com/extrawurst/gitui/issues/96))
129152
- expressive error when run in bare repos ([#100](https://github.com/extrawurst/gitui/issues/100))
130153

131154
## [0.4.0] - 2020-05-25
132155

133156
### Added
157+
134158
- stashing support (save,apply,drop) ([#3](https://github.com/extrawurst/gitui/issues/3))
135159

136160
### Changed
161+
137162
- log tab refreshes when head changes ([#78](https://github.com/extrawurst/gitui/issues/78))
138163
- performance optimization of the log tab in big repos
139164
- more readable default color for the commit hash in the log tab
140-
- more error/panic resiliance (`unwrap`/`panic` denied by clippy now) [[@MCord](https://github.com/MCord)] ([#77](https://github.com/extrawurst/gitui/issues/77))
165+
- more error/panic resiliance (`unwrap`/`panic` denied by clippy now) [[@MCord](https://github.com/MCord)](<[#77](https://github.com/extrawurst/gitui/issues/77)>)
141166

142167
### Fixes
168+
143169
- panic on small terminal width ([#72](https://github.com/extrawurst/gitui/issues/72))
144170

145171
![](assets/stashing.gif)
146172

147173
## [0.3.0] - 2020-05-20
148174

149175
### Added
150-
- support color themes and light mode [[@MCord](https://github.com/MCord)] ([#28](https://github.com/extrawurst/gitui/issues/28))
176+
177+
- support color themes and light mode [[@MCord](https://github.com/MCord)](<[#28](https://github.com/extrawurst/gitui/issues/28)>)
151178

152179
### Changed
180+
153181
- more natural scrolling in log tab ([#52](https://github.com/extrawurst/gitui/issues/52))
154182

155183
### Fixed
184+
156185
- crash on commit when git name was not set ([#74](https://github.com/extrawurst/gitui/issues/74))
157186
- log tab shown empty in single commit repos ([#75](https://github.com/extrawurst/gitui/issues/75))
158187

159188
![](assets/light-theme.png)
160189

161190
## [0.2.6] - 2020-05-18
191+
162192
### Fixed
193+
163194
- fix crash help in small window size ([#63](https://github.com/extrawurst/gitui/issues/63))
164195

165196
## [0.2.5] - 2020-05-16
197+
166198
### Added
199+
167200
- introduced proper changelog
168-
- hook support on windows [[@MCord](https://github.com/MCord)] ([#14](https://github.com/extrawurst/gitui/issues/14))
201+
- hook support on windows [[@MCord](https://github.com/MCord)](<[#14](https://github.com/extrawurst/gitui/issues/14)>)
169202

170203
### Changed
204+
171205
- show longer commit messages in log view
172-
- introduce propper error handling in `asyncgit` [[@MCord](https://github.com/MCord)] ([#53](https://github.com/extrawurst/gitui/issues/53))
206+
- introduce propper error handling in `asyncgit` [[@MCord](https://github.com/MCord)](<[#53](https://github.com/extrawurst/gitui/issues/53)>)
173207
- better error message when trying to run outside of a valid git repo ([#56](https://github.com/extrawurst/gitui/issues/56))
174208
- improve ctrl+c handling so it is checked first and no component needs to worry of blocking it
175209

176210
### Fixed
211+
177212
- support multiple tags per commit in log ([#61](https://github.com/extrawurst/gitui/issues/61))
178213

179214
## [0.2.3] - 2020-05-12
215+
180216
### Added
217+
181218
- support more navigation keys: home/end/pageUp/pageDown ([#43](https://github.com/extrawurst/gitui/issues/43))
182219
- highlight current tab a bit better
183220

184221
## [0.2.2] - 2020-05-10
222+
185223
### Added
224+
186225
- show tags in commit log ([#47](https://github.com/extrawurst/gitui/issues/47))
187226
- support home/end key in diff ([#43](https://github.com/extrawurst/gitui/issues/43))
188227

189228
### Changed
229+
190230
- close application shortcut is now the standard `ctrl+c`
191231
- some diff improvements ([#42](https://github.com/extrawurst/gitui/issues/42))
192232

193233
### Fixed
234+
194235
- document tab key to switch tabs ([#48](https://github.com/extrawurst/gitui/issues/48))

Diff for: src/components/commitlist.rs

+2
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ impl CommitList {
7979
///
8080
pub fn set_count_total(&mut self, total: usize) {
8181
self.count_total = total;
82+
self.selection =
83+
cmp::min(self.selection, self.selection_max());
8284
}
8385

8486
///

0 commit comments

Comments
 (0)