@@ -86,6 +86,7 @@ export class ChatInputPart extends Disposable implements IHistoryNavigationWidge
86
86
private historyStates : Map < string , any > = new Map ( ) ;
87
87
private historyNavigationBackwardsEnablement ! : IContextKey < boolean > ;
88
88
private historyNavigationForewardsEnablement ! : IContextKey < boolean > ;
89
+ private onHistoryEntry = false ;
89
90
private inputModel : ITextModel | undefined ;
90
91
private inputEditorHasText : IContextKey < boolean > ;
91
92
private chatCursorAtTop : IContextKey < boolean > ;
@@ -161,6 +162,8 @@ export class ChatInputPart extends Disposable implements IHistoryNavigationWidge
161
162
( this . history . previous ( ) ?? this . history . first ( ) ) : this . history . next ( ) )
162
163
?? '' ;
163
164
165
+ this . onHistoryEntry = previous || this . history . current ( ) !== null ;
166
+
164
167
aria . status ( historyInput ) ;
165
168
this . setValue ( historyInput ) ;
166
169
this . _onDidLoadInputState . fire ( this . historyStates . get ( historyInput ) ) ;
@@ -272,6 +275,10 @@ export class ChatInputPart extends Disposable implements IHistoryNavigationWidge
272
275
const model = this . _inputEditor . getModel ( ) ;
273
276
const inputHasText = ! ! model && model . getValueLength ( ) > 0 ;
274
277
this . inputEditorHasText . set ( inputHasText ) ;
278
+ if ( ! this . onHistoryEntry ) {
279
+ this . historyNavigationForewardsEnablement . set ( ! inputHasText ) ;
280
+ this . historyNavigationBackwardsEnablement . set ( ! inputHasText ) ;
281
+ }
275
282
} ) ) ;
276
283
this . _register ( this . _inputEditor . onDidFocusEditorText ( ( ) => {
277
284
this . _onDidFocus . fire ( ) ;
@@ -289,9 +296,12 @@ export class ChatInputPart extends Disposable implements IHistoryNavigationWidge
289
296
}
290
297
291
298
const atTop = e . position . column === 1 && e . position . lineNumber === 1 ;
292
- this . historyNavigationBackwardsEnablement . set ( atTop ) ;
293
299
this . chatCursorAtTop . set ( atTop ) ;
294
- this . historyNavigationForewardsEnablement . set ( e . position . equals ( getLastPosition ( model ) ) ) ;
300
+
301
+ if ( this . onHistoryEntry ) {
302
+ this . historyNavigationBackwardsEnablement . set ( atTop ) ;
303
+ this . historyNavigationForewardsEnablement . set ( e . position . equals ( getLastPosition ( model ) ) ) ;
304
+ }
295
305
} ) ) ;
296
306
297
307
this . toolbar = this . _register ( this . instantiationService . createInstance ( MenuWorkbenchToolBar , inputContainer , MenuId . ChatExecute , {
0 commit comments