Truncate description in tab title when it is too long

This commit is contained in:
Antonio Scandurra 2022-07-14 15:12:16 +02:00
parent 07d269234f
commit fd5cb02ea9
3 changed files with 9 additions and 4 deletions

View file

@ -4,7 +4,7 @@ use crate::{
ToggleWholeWord,
};
use collections::HashMap;
use editor::{Anchor, Autoscroll, Editor, MultiBuffer, SelectAll};
use editor::{Anchor, Autoscroll, Editor, MultiBuffer, SelectAll, MAX_TAB_TITLE_LEN};
use gpui::{
actions, elements::*, platform::CursorStyle, Action, AppContext, ElementBox, Entity,
ModelContext, ModelHandle, MutableAppContext, RenderContext, Subscription, Task, View,
@ -26,8 +26,6 @@ use workspace::{
actions!(project_search, [Deploy, SearchInNew, ToggleFocus]);
const MAX_TAB_TITLE_LEN: usize = 24;
#[derive(Default)]
struct ActiveSearches(HashMap<WeakModelHandle<Project>, WeakViewHandle<ProjectSearchView>>);