diff --git a/src-tauri/src/repositories/repositories.rs b/src-tauri/src/repositories/repositories.rs index e0803e0ea..4ffa10c4b 100644 --- a/src-tauri/src/repositories/repositories.rs +++ b/src-tauri/src/repositories/repositories.rs @@ -1,6 +1,6 @@ use crate::{deltas, fs, projects, sessions, users}; use anyhow::{Context, Result}; -use git2::{Cred, Signature}; +use git2::{BranchType, Cred, Signature}; use std::{collections::HashMap, env, path::Path}; use tauri::regex::Regex; use walkdir::WalkDir; @@ -158,7 +158,7 @@ impl Repository { pub fn branches(&self) -> Result> { let mut branches = vec![]; - for branch in self.git_repository.branches(None)? { + for branch in self.git_repository.branches(Some(BranchType::Local))? { let (branch, _) = branch?; branches.push(branch.name()?.unwrap().to_string()); } diff --git a/src/lib/components/CommandPalette.svelte b/src/lib/components/CommandPalette.svelte index a9f80ec22..166e6b54b 100644 --- a/src/lib/components/CommandPalette.svelte +++ b/src/lib/components/CommandPalette.svelte @@ -119,6 +119,11 @@ } else { items[items.length - 1].classList.add(...activeClass); } + // scroll into view + const active2 = menu.querySelector('li.active'); + if (active2) { + active2.scrollIntoView({ block: 'nearest' }); + } } } @@ -136,6 +141,11 @@ } else { items[0].classList.add(...activeClass); } + // scroll into view + const active2 = menu.querySelector('li.active'); + if (active2) { + active2.scrollIntoView({ block: 'nearest' }); + } } }