Commit 716e732469
Unsigned
Layout: unified · split
src/global/functions/command_capture.rs +4
| @@ -137,6 +137,10 @@ pub fn command_capture(framework: &mut FrameworkClean, key: KeyEvent) -> bool { | ||
| 137 | 137 | let text_field = status.command_capture.as_mut().unwrap(); |
| 138 | 138 | status.command_history_index = None; |
| 139 | 139 | text_field.content = status.command_editing_cache.clone(); |
| 140 | text_field.cursor = text_field.cursor.min(text_field.content.len()); | |
| 141 | if !text_field.content.is_empty() { | |
| 142 | let _ = text_field.last(); | |
| 143 | } | |
| 140 | 144 | } else { |
| 141 | 145 | let new_index = status.command_history_index.unwrap_or(history.0.len()) + 1; |
| 142 | 146 | let new_content = history.0[new_index].clone(); |
src/run.rs +5
| @@ -174,6 +174,11 @@ pub fn run( | ||
| 174 | 174 | status.command_history_index = None; |
| 175 | 175 | text_field.content = |
| 176 | 176 | status.command_editing_cache.clone(); |
| 177 | text_field.cursor = | |
| 178 | text_field.cursor.min(text_field.content.len()); | |
| 179 | if !text_field.content.is_empty() { | |
| 180 | let _ = text_field.last(); | |
| 181 | } | |
| 177 | 182 | } else { |
| 178 | 183 | let new_index = status |
| 179 | 184 | .command_history_index |