@@ -86,6 +86,7 @@ export class ChatInputPart extends Disposable implements IHistoryNavigationWidge
86
86
private historyNavigationBackwardsEnablement ! : IContextKey < boolean > ;
87
87
private historyNavigationForewardsEnablement ! : IContextKey < boolean > ;
88
88
private onHistoryEntry = false ;
89
+ private inHistoryNavigation = false ;
89
90
private inputModel : ITextModel | undefined ;
90
91
private inputEditorHasText : IContextKey < boolean > ;
91
92
private chatCursorAtTop : IContextKey < boolean > ;
@@ -160,7 +161,11 @@ export class ChatInputPart extends Disposable implements IHistoryNavigationWidge
160
161
this . onHistoryEntry = previous || this . history . current ( ) !== null ;
161
162
162
163
aria . status ( historyEntry . text ) ;
164
+
165
+ this . inHistoryNavigation = true ;
163
166
this . setValue ( historyEntry . text ) ;
167
+ this . inHistoryNavigation = false ;
168
+
164
169
this . _onDidLoadInputState . fire ( historyEntry . state ) ;
165
170
if ( previous ) {
166
171
this . _inputEditor . setPosition ( { lineNumber : 1 , column : 1 } ) ;
@@ -269,6 +274,12 @@ export class ChatInputPart extends Disposable implements IHistoryNavigationWidge
269
274
const model = this . _inputEditor . getModel ( ) ;
270
275
const inputHasText = ! ! model && model . getValueLength ( ) > 0 ;
271
276
this . inputEditorHasText . set ( inputHasText ) ;
277
+
278
+ // If the user is typing on a history entry, then reset the onHistoryEntry flag so that history navigation can be disabled
279
+ if ( ! this . inHistoryNavigation ) {
280
+ this . onHistoryEntry = false ;
281
+ }
282
+
272
283
if ( ! this . onHistoryEntry ) {
273
284
this . historyNavigationForewardsEnablement . set ( ! inputHasText ) ;
274
285
this . historyNavigationBackwardsEnablement . set ( ! inputHasText ) ;
0 commit comments