|
|
@@ -926,13 +926,7 @@ export function Prompt(props: PromptProps) {
|
|
|
target: inputTarget,
|
|
|
enabled: (() => {
|
|
|
cursorVersion()
|
|
|
- return (
|
|
|
- inputTarget() !== undefined &&
|
|
|
- !props.disabled &&
|
|
|
- !auto()?.visible &&
|
|
|
- input !== undefined &&
|
|
|
- (input.cursorOffset === 0 || input.visualCursor.visualRow === 0)
|
|
|
- )
|
|
|
+ return inputTarget() !== undefined && !props.disabled && !auto()?.visible && input !== undefined
|
|
|
})(),
|
|
|
commands: [
|
|
|
{
|
|
|
@@ -941,12 +935,12 @@ export function Prompt(props: PromptProps) {
|
|
|
category: "Prompt",
|
|
|
run() {
|
|
|
if (input.cursorOffset !== 0) {
|
|
|
- input.cursorOffset = 0
|
|
|
- return
|
|
|
+ if (input.scrollY + input.visualCursor.visualRow === 0) input.cursorOffset = 0
|
|
|
+ return false
|
|
|
}
|
|
|
|
|
|
const item = history.move(-1, input.plainText)
|
|
|
- if (!item) return
|
|
|
+ if (!item) return false
|
|
|
input.setText(item.input)
|
|
|
setStore("prompt", item)
|
|
|
setStore("mode", item.mode ?? "normal")
|
|
|
@@ -964,13 +958,7 @@ export function Prompt(props: PromptProps) {
|
|
|
target: inputTarget,
|
|
|
enabled: (() => {
|
|
|
cursorVersion()
|
|
|
- return (
|
|
|
- inputTarget() !== undefined &&
|
|
|
- !props.disabled &&
|
|
|
- !auto()?.visible &&
|
|
|
- input !== undefined &&
|
|
|
- (input.cursorOffset === input.plainText.length || input.visualCursor.visualRow === input.height - 1)
|
|
|
- )
|
|
|
+ return inputTarget() !== undefined && !props.disabled && !auto()?.visible && input !== undefined
|
|
|
})(),
|
|
|
commands: [
|
|
|
{
|
|
|
@@ -979,12 +967,16 @@ export function Prompt(props: PromptProps) {
|
|
|
category: "Prompt",
|
|
|
run() {
|
|
|
if (input.cursorOffset !== input.plainText.length) {
|
|
|
- input.cursorOffset = input.plainText.length
|
|
|
- return
|
|
|
+ if (
|
|
|
+ input.scrollY + input.visualCursor.visualRow ===
|
|
|
+ Math.max(0, input.editorView.getTotalVirtualLineCount() - 1)
|
|
|
+ )
|
|
|
+ input.cursorOffset = input.plainText.length
|
|
|
+ return false
|
|
|
}
|
|
|
|
|
|
const item = history.move(1, input.plainText)
|
|
|
- if (!item) return
|
|
|
+ if (!item) return false
|
|
|
input.setText(item.input)
|
|
|
setStore("prompt", item)
|
|
|
setStore("mode", item.mode ?? "normal")
|