@@ -44,24 +44,26 @@ async function buildEditor() {
44
44
theme: themePath,
45
45
useWorker: false ,
46
46
value: props .modelValue ,
47
+ wrap: true ,
47
48
});
48
49
49
- /* / Update modelValue when editor content changes
50
- // Set the mode (language) if needed
51
- editor.session.setMode("ace/mode/javascript");
52
- aceEditor.session.on('change', () => {
53
- const newValue = aceEditor.getValue();
54
- emit('update:modelValue', newValue);
55
- });*/
56
-
57
50
aceEditor .on (" focus" , () => {
58
51
aceEditor .setOption (" highlightActiveLine" , true );
59
52
aceEditor .setOption (" highlightGutterLine" , true );
53
+ editor .value .classList .add (" cell-code-focus" );
60
54
});
61
55
aceEditor .on (" blur" , () => {
62
56
aceEditor .setOption (" highlightActiveLine" , false );
63
57
aceEditor .setOption (" highlightGutterLine" , false );
58
+ editor .value .classList .remove (" cell-code-focus" );
64
59
});
60
+
61
+ /* / Update modelValue when editor content changes
62
+ // Set the mode (language) if needed
63
+ aceEditor.session.on('change', () => {
64
+ const newValue = aceEditor.getValue();
65
+ emit('update:modelValue', newValue);
66
+ });*/
65
67
}
66
68
67
69
// Initialize the Ace editor
@@ -79,3 +81,10 @@ onMounted(() => {
79
81
}
80
82
);*/
81
83
</script >
84
+
85
+ <style lang="scss">
86
+ @import " theme/blue.scss" ;
87
+ .cell-code-focus {
88
+ background-color : $gray-100 ;
89
+ }
90
+ </style >
0 commit comments