Filter out excessively long paths
This commit is contained in:
parent
ee6a8a20e2
commit
87609557f0
1 changed files with 7 additions and 0 deletions
|
@ -75,6 +75,9 @@ const MAX_EVENT_COUNT: usize = 16;
|
||||||
/// Maximum number of recent files to track.
|
/// Maximum number of recent files to track.
|
||||||
const MAX_RECENT_PROJECT_ENTRIES_COUNT: usize = 16;
|
const MAX_RECENT_PROJECT_ENTRIES_COUNT: usize = 16;
|
||||||
|
|
||||||
|
/// Maximum file path length to include in recent files list.
|
||||||
|
const MAX_RECENT_FILE_PATH_LENGTH: usize = 512;
|
||||||
|
|
||||||
/// Maximum number of edit predictions to store for feedback.
|
/// Maximum number of edit predictions to store for feedback.
|
||||||
const MAX_SHOWN_COMPLETION_COUNT: usize = 50;
|
const MAX_SHOWN_COMPLETION_COUNT: usize = 50;
|
||||||
|
|
||||||
|
@ -1184,6 +1187,10 @@ and then another
|
||||||
self.recent_project_entries.remove(ix);
|
self.recent_project_entries.remove(ix);
|
||||||
continue;
|
continue;
|
||||||
};
|
};
|
||||||
|
if repo_path_str.len() > MAX_RECENT_FILE_PATH_LENGTH {
|
||||||
|
self.recent_project_entries.remove(ix);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if let Some(file_status) = repository.status_for_path(&repo_path) {
|
if let Some(file_status) = repository.status_for_path(&repo_path) {
|
||||||
if file_status.is_ignored() || file_status.is_untracked() {
|
if file_status.is_ignored() || file_status.is_untracked() {
|
||||||
// entry not removed because it may belong to a nested repository
|
// entry not removed because it may belong to a nested repository
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue