Skip to content

Commit

Permalink
always recreate the item when splitting into an existing pane. this e…
Browse files Browse the repository at this point in the history
…nsures the cursor position is the same.
  • Loading branch information
carlsverre committed Feb 26, 2025
1 parent 78fa659 commit 2915073
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 24 deletions.
11 changes: 10 additions & 1 deletion crates/workspace/src/workspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3515,7 +3515,16 @@ impl Workspace {
{
let target_pane = self.find_or_create_pane_in_direction(window, &pane, direction, cx);
target_pane.update(cx, |pane, cx| {
pane.add_item(clone, true, true, None, window, cx)
let project_entry_id = clone
.is_singleton(cx)
.then_some(Some(()))
.and_then(|_| clone.project_entry_ids(cx).first().cloned());
if let Some(project_entry_id) = project_entry_id {
if let Some(existing) = pane.item_for_entry(project_entry_id, cx) {
pane.remove_item(existing.item_id(), true, false, window, cx);
}
}
pane.add_item(clone, true, true, None, window, cx);
});
Some(target_pane)
} else {
Expand Down
23 changes: 0 additions & 23 deletions script/bundle-linux
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ version_info=$(rustc --version --verbose)
host_line=$(echo "$version_info" | grep host)
target_triple=${host_line#*: }
musl_triple=${target_triple%-gnu}-musl
remote_server_triple=${REMOTE_SERVER_TARGET:-"${musl_triple}"}
rustup_installed=false
if command -v rustup >/dev/null 2>&1; then
rustup_installed=true
Expand All @@ -48,47 +47,26 @@ fi
# Generate the licenses first, so they can be baked into the binaries
script/generate-licenses

if "$rustup_installed"; then
rustup target add "$remote_server_triple"
fi

export CC=$(which clang)

# Build binary in release mode
export RUSTFLAGS="${RUSTFLAGS:-} -C link-args=-Wl,--disable-new-dtags,-rpath,\$ORIGIN/../lib"
cargo build --release --target "${target_triple}" --package zed --package cli
# Build remote_server in separate invocation to prevent feature unification from other crates
# from influencing dynamic libraries required by it.
if [[ "$remote_server_triple" == "$musl_triple" ]]; then
export RUSTFLAGS="${RUSTFLAGS:-} -C target-feature=+crt-static"
fi
cargo build --release --target "${remote_server_triple}" --package remote_server

# Strip debug symbols and save them for upload to DigitalOcean
objcopy --only-keep-debug "${target_dir}/${target_triple}/release/zed" "${target_dir}/${target_triple}/release/zed.dbg"
objcopy --only-keep-debug "${target_dir}/${remote_server_triple}/release/remote_server" "${target_dir}/${remote_server_triple}/release/remote_server.dbg"
objcopy --strip-debug "${target_dir}/${target_triple}/release/zed"
objcopy --strip-debug "${target_dir}/${target_triple}/release/cli"
objcopy --strip-debug "${target_dir}/${remote_server_triple}/release/remote_server"

gzip -f "${target_dir}/${target_triple}/release/zed.dbg"
gzip -f "${target_dir}/${remote_server_triple}/release/remote_server.dbg"

if [[ -n "${DIGITALOCEAN_SPACES_SECRET_KEY:-}" && -n "${DIGITALOCEAN_SPACES_ACCESS_KEY:-}" ]]; then
upload_to_blob_store_public \
"zed-debug-symbols" \
"${target_dir}/${target_triple}/release/zed.dbg.gz" \
"$channel/zed-$version-${target_triple}.dbg.gz"
upload_to_blob_store_public \
"zed-debug-symbols" \
"${target_dir}/${remote_server_triple}/release/remote_server.dbg.gz" \
"$channel/remote_server-$version-${remote_server_triple}.dbg.gz"
fi

# Ensure that remote_server does not depend on libssl nor libcrypto, as we got rid of these deps.
if ldd "${target_dir}/${remote_server_triple}/release/remote_server" | grep -q 'libcrypto\|libssl'; then
echo "Error: remote_server still depends on libssl or libcrypto" && exit 1
fi

suffix=""
if [ "$channel" != "stable" ]; then
Expand Down Expand Up @@ -157,4 +135,3 @@ remove_match="zed(-[a-zA-Z0-9]+)?-linux-$(uname -m)\.tar\.gz"
ls "${target_dir}/release" | grep -E ${remove_match} | xargs -d "\n" -I {} rm -f "${target_dir}/release/{}" || true
tar -czvf "${target_dir}/release/$archive" -C ${temp_dir} "zed$suffix.app"

gzip -f --stdout --best "${target_dir}/${remote_server_triple}/release/remote_server" > "${target_dir}/zed-remote-server-linux-${arch}.gz"

0 comments on commit 2915073

Please sign in to comment.