Add general new tab settings

This commit is contained in:
2026-05-08 03:13:37 -04:00
parent 6750f60d52
commit 4bdbf5e0c5
14 changed files with 369 additions and 22 deletions
@@ -126,7 +126,7 @@ impl BrowserCore {
match command.to_ascii_lowercase().as_str() {
"new-tab" => {
self.open_tab(self.new_tab_url.clone());
self.open_new_tab()?;
Ok(true)
}
"split-right" | "split right" => {
@@ -53,7 +53,7 @@ impl BrowserCore {
let tab = self.build_tab_for(
self.active_space_id.clone(),
profile_id.clone(),
self.new_tab_url.clone(),
self.new_tab_url()?,
);
let tab_id = tab.id().clone();
let insert_index = self
+2 -2
View File
@@ -75,7 +75,7 @@ impl BrowserCore {
let active_profile_id = self.tabs[active_index].profile_id().clone();
let split_id = self.split_id_for_new_pane(&active_tab_id)?;
let mut new_tab =
self.build_tab_for(active_space_id, active_profile_id, self.new_tab_url.clone());
self.build_tab_for(active_space_id, active_profile_id, self.new_tab_url()?);
let new_tab_id = new_tab.id().clone();
new_tab.set_split_id(split_id.clone());
@@ -276,7 +276,7 @@ impl BrowserCore {
let replacement = self.build_tab_for(
closed_space_id.clone(),
closed_profile_id.clone(),
self.new_tab_url.clone(),
self.new_tab_url()?,
);
let replacement_id = replacement.id().clone();
self.tabs.insert(start_index.min(self.tabs.len()), replacement);
+7 -2
View File
@@ -14,6 +14,11 @@ use super::BrowserCore;
const DEFAULT_FAVORITE_LIMIT: usize = 12;
impl BrowserCore {
pub fn open_new_tab(&mut self) -> Result<TabId, CoreError> {
let url = self.new_tab_url()?;
Ok(self.open_tab(url))
}
pub fn open_tab(&mut self, url: UrlText) -> TabId {
let tab = self.build_tab(url);
let tab_id = tab.id().clone();
@@ -62,7 +67,7 @@ impl BrowserCore {
let tab = self.build_tab_for(
source_space_id.clone(),
self.active_profile_id.clone(),
self.new_tab_url.clone(),
self.new_tab_url()?,
);
let replacement_id = tab.id().clone();
self.tabs.insert(tab_index, tab);
@@ -125,7 +130,7 @@ impl BrowserCore {
let tab = self.build_tab_for(
closed_space_id.clone(),
closed_profile_id.clone(),
self.new_tab_url.clone(),
self.new_tab_url()?,
);
let replacement_id = tab.id().clone();
self.tabs.insert(close_index.min(self.tabs.len()), tab);