@@ -13,6 +13,7 @@ import { useEditorInstanceStore } from "@/stores/editor-instance-store";
13
13
import { useEditorSearchStore } from "@/stores/editor-search-store" ;
14
14
import { useEditorSettingsStore } from "@/stores/editor-settings-store" ;
15
15
import { useLspStore } from "@/stores/lsp-store" ;
16
+ import { useZoomStore } from "@/stores/zoom-store" ;
16
17
import { useGitGutter } from "@/version-control/git/controllers/use-git-gutter" ;
17
18
import FindBar from "../find-bar" ;
18
19
import Breadcrumb from "./breadcrumb" ;
@@ -36,13 +37,13 @@ export interface CodeEditorRef {
36
37
37
38
const CodeEditor = ( { className } : CodeEditorProps ) => {
38
39
const editorRef = useRef < HTMLDivElement > ( null as any ) ;
39
-
40
40
const { setRefs, setContent, setFileInfo } = useEditorInstanceStore ( ) ;
41
41
// No longer need to sync content - editor-view-store computes from buffer
42
42
const { setDisabled } = useEditorSettingsStore . use . actions ( ) ;
43
43
44
44
const buffers = useBufferStore . use . buffers ( ) ;
45
45
const activeBufferId = useBufferStore . use . activeBufferId ( ) ;
46
+ const zoomLevel = useZoomStore . use . editorZoomLevel ( ) ;
46
47
const activeBuffer = buffers . find ( ( b ) => b . id === activeBufferId ) || null ;
47
48
const { handleContentChange } = useAppStore . use . actions ( ) ;
48
49
const { searchQuery, searchMatches, currentMatchIndex, setSearchMatches, setCurrentMatchIndex } =
@@ -146,7 +147,6 @@ const CodeEditor = ({ className }: CodeEditorProps) => {
146
147
147
148
// Get cursor position
148
149
const cursorPosition = useEditorCursorStore . use . cursorPosition ( ) ;
149
-
150
150
// Track typing speed for dynamic debouncing
151
151
const lastTypeTimeRef = useRef < number > ( Date . now ( ) ) ;
152
152
const typingSpeedRef = useRef < number > ( 500 ) ;
@@ -264,7 +264,14 @@ const CodeEditor = ({ className }: CodeEditorProps) => {
264
264
< div
265
265
ref = { editorRef }
266
266
className = { `editor-container relative flex-1 overflow-hidden ${ className || "" } ` }
267
- style = { { scrollbarWidth : "none" , msOverflowStyle : "none" } }
267
+ style = { {
268
+ scrollbarWidth : "none" ,
269
+ msOverflowStyle : "none" ,
270
+ transform : `scale(${ zoomLevel } )` ,
271
+ transformOrigin : "top left" ,
272
+ width : `${ 100 / zoomLevel } %` ,
273
+ height : `${ 100 / zoomLevel } %` ,
274
+ } }
268
275
>
269
276
{ /* Hover Tooltip */ }
270
277
< HoverTooltip />
0 commit comments