Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions bun.lock
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"@commitlint/cli": "^19.8.1",
"@tailwindcss/vite": "^4.1.11",
"@tauri-apps/cli": "^2",
"@types/bun": "^1.2.21",
"@types/node": "^24.1.0",
"@types/react": "^19.1.8",
"@types/react-dom": "^19.1.6",
Expand Down Expand Up @@ -452,6 +453,8 @@

"@types/babel__traverse": ["@types/[email protected]", "", { "dependencies": { "@babel/types": "^7.20.7" } }, "sha512-dkO5fhS7+/oos4ciWxyEyjWe48zmG6wbCheo/G2ZnHx4fs3EU6YC6UM8rk56gAjNJ9P3MTH2jo5jb92/K6wbng=="],

"@types/bun": ["@types/[email protected]", "", { "dependencies": { "bun-types": "1.2.21" } }, "sha512-NiDnvEqmbfQ6dmZ3EeUO577s4P5bf4HCTXtI6trMc6f6RzirY5IrF3aIookuSpyslFzrnvv2lmEWv5HyC1X79A=="],

"@types/conventional-commits-parser": ["@types/[email protected]", "", { "dependencies": { "@types/node": "*" } }, "sha512-7uz5EHdzz2TqoMfV7ee61Egf5y6NkcO4FB/1iCCQnbeiI1F3xzv3vK5dBCXUCLQgGYS+mUeigK1iKQzvED+QnQ=="],

"@types/estree": ["@types/[email protected]", "", {}, "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w=="],
Expand Down Expand Up @@ -514,6 +517,8 @@

"browserslist": ["[email protected]", "", { "dependencies": { "caniuse-lite": "^1.0.30001726", "electron-to-chromium": "^1.5.173", "node-releases": "^2.0.19", "update-browserslist-db": "^1.1.3" }, "bin": { "browserslist": "cli.js" } }, "sha512-KGj0KoOMXLpSNkkEI6Z6mShmQy0bc1I+T7K9N81k4WWMrfz+6fQ6es80B/YLAeRoKvjYE1YSHHOW1qe9xIVzHw=="],

"bun-types": ["[email protected]", "", { "dependencies": { "@types/node": "*" }, "peerDependencies": { "@types/react": "^19" } }, "sha512-sa2Tj77Ijc/NTLS0/Odjq/qngmEPZfbfnOERi0KRUYhT9R8M4VBioWVmMWE5GrYbKMc+5lVybXygLdibHaqVqw=="],

"callsites": ["[email protected]", "", {}, "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ=="],

"caniuse-lite": ["[email protected]", "", {}, "sha512-pB68nIHmbN6L/4C6MH1DokyR3bYqFwjaSs/sWDHGj4CTcFtQUQMuJftVwWkXq7mNWOybD3KhUv3oWHoGxgP14Q=="],
Expand Down
9 changes: 9 additions & 0 deletions docs/develop/linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ bun setup
1. **Install Bun**: Visit [bun.sh](https://bun.sh) for installation instructions
2. **Install Rust**: Visit [rustup.rs](https://rustup.rs) for installation instructions

**Additional Packages**

When installing `git2` and `ssh2` crates using `vendored-openssl` features, there are additional packages you may need to prevent installation failure

This one's for Fedora, but the packages should be the same for other distros
```sh
sudo dnf install openssl-devel pkgconf perl-FindBin perl-IPC-Cmd perl
```

### Setup

```bash
Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@
"clean": "concurrently --names \"node,rust\" --prefix-colors \"cyan,yellow\" \"rimraf dist build node_modules bun.lockb && bun install\" \"cargo clean && cargo build\"",
"prepare": "simple-git-hooks",
"commitlint": "commitlint",
"setup": "chmod +x scripts/linux/setup.sh && ./scripts/linux/setup.sh",
"setup:linux": "chmod +x scripts/linux/setup.sh && ./scripts/linux/setup.sh",
"setup-win": "powershell -ExecutionPolicy Bypass -File ./scripts/windows/setup.ps1",
"setup": "bun setup.ts",
"dev": "bun run tauri dev"
},
"dependencies": {
Expand Down Expand Up @@ -69,6 +67,7 @@
"@commitlint/cli": "^19.8.1",
"@tailwindcss/vite": "^4.1.11",
"@tauri-apps/cli": "^2",
"@types/bun": "^1.2.21",
"@types/node": "^24.1.0",
"@types/react": "^19.1.8",
"@types/react-dom": "^19.1.6",
Expand Down
40 changes: 8 additions & 32 deletions scripts/linux/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,23 @@ install_system_deps() {
"ubuntu")
sudo apt update
sudo apt install -y build-essential curl wget file libssl-dev libgtk-3-dev libwebkit2gtk-4.1-dev libsoup-3.0-dev libayatana-appindicator3-dev librsvg2-dev pkg-config
# Deps for git2 and ssh2
sudo apt install -y openssl-devel pkgconf perl-FindBin perl-IPC-Cmd perl
;;
"fedora")
sudo dnf install -y gcc gcc-c++ make curl wget file openssl-devel gtk3-devel webkit2gtk4.1-devel libsoup3-devel libayatana-appindicator-gtk3-devel librsvg2-devel pkgconf-pkg-config
# Deps for git2 and ssh2
sudo dnf install -y openssl-devel pkgconf perl-FindBin perl-IPC-Cmd perl
;;
"arch")
sudo pacman -S --needed --noconfirm base-devel curl wget file openssl gtk3 webkit2gtk-4.1 libsoup3 libayatana-appindicator librsvg pkgconf
# Deps for git2 and ssh2
sudo pacman -S --needed --noconfirm openssl-devel pkgconf perl-FindBin perl-IPC-Cmd perl
;;
"opensuse")
sudo zypper install -y gcc gcc-c++ make curl wget file libopenssl-devel gtk3-devel webkit2gtk3-devel libsoup3-devel libayatana-appindicator3-devel librsvg-devel pkg-config
# Deps for git2 and ssh2
sudo zypper install -y openssl-devel pkgconf perl-FindBin perl-IPC-Cmd perl
;;
*)
print_error "Unsupported Linux distribution: $DISTRO"
Expand Down Expand Up @@ -95,34 +103,6 @@ install_bun() {
fi
}

install_node() {
if command_exists node; then
NODE_VERSION=$(node --version | cut -d'v' -f2 | cut -d'.' -f1)
if [ "$NODE_VERSION" -ge 18 ]; then
print_success "Node.js is already installed ($(node --version))"
return
fi
fi

print_status "Installing Node.js LTS..."
case $DISTRO in
"ubuntu")
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt-get install -y nodejs
;;
"fedora")
sudo dnf install -y nodejs npm
;;
"arch")
sudo pacman -S --needed --noconfirm nodejs npm
;;
"opensuse")
sudo zypper install -y nodejs18 npm18
;;
esac
print_success "Node.js installation completed"
}

install_project_deps() {
print_status "Installing project dependencies..."

Expand All @@ -131,9 +111,6 @@ install_project_deps() {
if command_exists bun; then
bun install
print_success "Dependencies installed with Bun"
elif command_exists npm; then
npm install
print_success "Dependencies installed with npm"
else
print_warning "Package manager not found, but continuing..."
fi
Expand Down Expand Up @@ -173,7 +150,6 @@ main() {
install_rust
install_tauri_cli
install_bun
install_node
install_project_deps
verify_basic

Expand Down
14 changes: 14 additions & 0 deletions setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import os from "node:os";
import { $ } from "bun";

const WINDOWS = "win32";
const MAC = "darwin";
const LINUX = "linux";

const platform = os.platform();

if (platform === WINDOWS) {
await $`powershell -ExecutionPolicy Bypass -File ./scripts/windows/setup.ps1`;
} else if (platform === MAC || platform === LINUX) {
await $`chmod +x scripts/linux/setup.sh && ./scripts/linux/setup.sh`;
}
30 changes: 30 additions & 0 deletions src/components/editor/overlays/editor-context-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
Code,
Copy,
FileText,
GitMerge,
Indent,
Outdent,
RotateCcw,
Expand All @@ -18,6 +19,7 @@ import {
} from "lucide-react";
import { useEffect, useRef } from "react";
import { useEditorCursorStore } from "@/stores/editor-cursor-store";
import { useEditorSettingsStore } from "@/stores/editor-settings-store";
import KeybindingBadge from "../../ui/keybinding-badge";

interface EditorContextMenuProps {
Expand All @@ -41,6 +43,7 @@ interface EditorContextMenuProps {
onMoveLineDown?: () => void;
onInsertLine?: () => void;
onToggleBookmark?: () => void;
onToggleInlineDiff?: () => void;
}

const EditorContextMenu = ({
Expand All @@ -64,10 +67,13 @@ const EditorContextMenu = ({
onMoveLineDown,
onInsertLine,
onToggleBookmark,
onToggleInlineDiff,
}: EditorContextMenuProps) => {
const menuRef = useRef<HTMLDivElement>(null);
const selection = useEditorCursorStore.use.selection?.() ?? undefined;
const hasSelection = selection && selection.start.offset !== selection.end.offset;
const showInlineDiff = useEditorSettingsStore.use.showInlineDiff();
const { setShowInlineDiff } = useEditorSettingsStore.use.actions();

useEffect(() => {
if (!isOpen) return;
Expand Down Expand Up @@ -232,6 +238,16 @@ const EditorContextMenu = ({
onClose();
};

const handleToggleInlineDiff = () => {
if (onToggleInlineDiff) {
onToggleInlineDiff();
} else {
// Default behavior: toggle the setting directly
setShowInlineDiff(!showInlineDiff);
}
onClose();
};

return (
<div
ref={menuRef}
Expand Down Expand Up @@ -444,6 +460,20 @@ const EditorContextMenu = ({
</div>
<KeybindingBadge keys={["⌘", "K", "⌘", "K"]} className="opacity-60" />
</button>

<div className="my-0.5 border-border border-t" />

{/* Toggle Inline Git Diff */}
<button
className="flex w-full items-center justify-between gap-2 px-2.5 py-1 text-left font-mono text-text text-xs hover:bg-hover"
onClick={handleToggleInlineDiff}
>
<div className="flex items-center gap-2">
<GitMerge size={11} />
<span>{showInlineDiff ? "Hide" : "Show"} Inline Git Diff</span>
</div>
<div className="text-xs opacity-60">{showInlineDiff ? "✓" : ""}</div>
</button>
</div>
);
};
Expand Down
Loading
Loading