@@ -45,7 +45,7 @@ impl Console {
45
45
let mut editor = Editor :: multi_line ( window, cx) ;
46
46
editor. move_to_end ( & editor:: actions:: MoveToEnd , window, cx) ;
47
47
editor. set_read_only ( true ) ;
48
- editor. set_show_gutter ( true , cx) ;
48
+ editor. set_show_gutter ( false , cx) ;
49
49
editor. set_show_runnables ( false , cx) ;
50
50
editor. set_show_breakpoints ( false , cx) ;
51
51
editor. set_show_code_actions ( false , cx) ;
@@ -57,6 +57,8 @@ impl Console {
57
57
editor. set_show_wrap_guides ( false , cx) ;
58
58
editor. set_show_indent_guides ( false , cx) ;
59
59
editor. set_show_edit_predictions ( Some ( false ) , window, cx) ;
60
+ editor. set_use_modal_editing ( false ) ;
61
+ editor. set_soft_wrap_mode ( language:: language_settings:: SoftWrap :: EditorWidth , cx) ;
60
62
editor
61
63
} ) ;
62
64
let focus_handle = cx. focus_handle ( ) ;
@@ -146,6 +148,23 @@ impl Console {
146
148
expression
147
149
} ) ;
148
150
151
+ self . add_messages (
152
+ [ OutputEvent {
153
+ category : None ,
154
+ output : format ! ( "> {expression}" ) ,
155
+ group : None ,
156
+ variables_reference : None ,
157
+ source : None ,
158
+ line : None ,
159
+ column : None ,
160
+ data : None ,
161
+ location_reference : None ,
162
+ } ]
163
+ . iter ( ) ,
164
+ window,
165
+ cx,
166
+ ) ;
167
+
149
168
self . session . update ( cx, |session, cx| {
150
169
session
151
170
. evaluate (
@@ -160,6 +179,10 @@ impl Console {
160
179
}
161
180
162
181
fn render_console ( & self , cx : & Context < Self > ) -> impl IntoElement {
182
+ EditorElement :: new ( & self . console , self . editor_style ( cx) )
183
+ }
184
+
185
+ fn editor_style ( & self , cx : & Context < Self > ) -> EditorStyle {
163
186
let settings = ThemeSettings :: get_global ( cx) ;
164
187
let text_style = TextStyle {
165
188
color : if self . console . read ( cx) . read_only ( cx) {
@@ -174,44 +197,16 @@ impl Console {
174
197
line_height : relative ( settings. buffer_line_height . value ( ) ) ,
175
198
..Default :: default ( )
176
199
} ;
177
-
178
- EditorElement :: new (
179
- & self . console ,
180
- EditorStyle {
181
- background : cx. theme ( ) . colors ( ) . editor_background ,
182
- local_player : cx. theme ( ) . players ( ) . local ( ) ,
183
- text : text_style,
184
- ..Default :: default ( )
185
- } ,
186
- )
200
+ EditorStyle {
201
+ background : cx. theme ( ) . colors ( ) . editor_background ,
202
+ local_player : cx. theme ( ) . players ( ) . local ( ) ,
203
+ text : text_style,
204
+ ..Default :: default ( )
205
+ }
187
206
}
188
207
189
208
fn render_query_bar ( & self , cx : & Context < Self > ) -> impl IntoElement {
190
- let settings = ThemeSettings :: get_global ( cx) ;
191
- let text_style = TextStyle {
192
- color : if self . console . read ( cx) . read_only ( cx) {
193
- cx. theme ( ) . colors ( ) . text_disabled
194
- } else {
195
- cx. theme ( ) . colors ( ) . text
196
- } ,
197
- font_family : settings. ui_font . family . clone ( ) ,
198
- font_features : settings. ui_font . features . clone ( ) ,
199
- font_fallbacks : settings. ui_font . fallbacks . clone ( ) ,
200
- font_size : TextSize :: Editor . rems ( cx) . into ( ) ,
201
- font_weight : settings. ui_font . weight ,
202
- line_height : relative ( 1.3 ) ,
203
- ..Default :: default ( )
204
- } ;
205
-
206
- EditorElement :: new (
207
- & self . query_bar ,
208
- EditorStyle {
209
- background : cx. theme ( ) . colors ( ) . editor_background ,
210
- local_player : cx. theme ( ) . players ( ) . local ( ) ,
211
- text : text_style,
212
- ..Default :: default ( )
213
- } ,
214
- )
209
+ EditorElement :: new ( & self . query_bar , self . editor_style ( cx) )
215
210
}
216
211
}
217
212
0 commit comments