File tree Expand file tree Collapse file tree
ui/src/components/editor/panel/ChatInput/hooks
src/views/panel/backend/message-handlers/handle-at-sign-quick-pick Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -362,20 +362,30 @@ export const use_handlers = (
362362
363363 e . preventDefault ( )
364364
365+ const update_and_set_caret = ( value : string ) => {
366+ props . on_change ( value )
367+ set_caret_position_after_change (
368+ input_ref ,
369+ value . length ,
370+ value ,
371+ props . context_file_paths ?? [ ]
372+ )
373+ }
374+
365375 if ( e . key === 'ArrowUp' ) {
366376 if ( history_index < active_history . length - 1 ) {
367377 const new_index = history_index + 1
368378 set_history_index ( new_index )
369- props . on_change ( active_history [ new_index ] )
379+ update_and_set_caret ( active_history [ new_index ] )
370380 }
371381 } else if ( e . key === 'ArrowDown' ) {
372382 if ( history_index > 0 ) {
373383 const new_index = history_index - 1
374384 set_history_index ( new_index )
375- props . on_change ( active_history [ new_index ] )
385+ update_and_set_caret ( active_history [ new_index ] )
376386 } else if ( history_index === 0 ) {
377387 set_history_index ( - 1 )
378- props . on_change ( '' )
388+ update_and_set_caret ( '' )
379389 }
380390 }
381391 }
Original file line number Diff line number Diff line change 591591 "type" : " string" ,
592592 "scope" : " resource" ,
593593 "description" : " System instructions for the Edit Context API tool." ,
594- "default" : " You're a helpful coding assistant. Don't introduce redundant comments in code ."
594+ "default" : " You're a helpful coding assistant. Don't explain changes in inline comments ."
595595 },
596596 "codeWebChat.chatPresetsForAskAboutContext" : {
597597 "type" : " array" ,
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ const at_sign_quick_pick = async (params: {
6868 } )
6969
7070 if ( filtered_paths . length == 1 ) {
71- return `\`${ filtered_paths [ 0 ] } \` `
71+ return `\`${ filtered_paths [ 0 ] } \``
7272 } else if ( filtered_paths . length > 1 ) {
7373 const filtered_paths_set = new Set ( filtered_paths )
7474 quick_pick_items_to_show = all_quick_pick_items . filter ( ( item ) =>
@@ -94,7 +94,7 @@ const at_sign_quick_pick = async (params: {
9494 )
9595
9696 if ( selected_path_item ) {
97- return `\`${ selected_path_item . fullPath } \` `
97+ return `\`${ selected_path_item . fullPath } \``
9898 }
9999 return
100100}
You can’t perform that action at this time.
0 commit comments