Improve display of save as
This commit is contained in:
parent
02be6a133c
commit
1b748ed63e
@ -84,7 +84,7 @@ export class Document {
|
||||
}
|
||||
|
||||
const row = this.row(at.y)!;
|
||||
const mergeNextRow = at.x === row.size && at.y < len - 1;
|
||||
const mergeNextRow = at.x === row.size && at.y + 1 < len;
|
||||
const mergeIntoPrevRow = at.x === 0 && at.y > 0;
|
||||
|
||||
// If we are at the end of a line, and press delete,
|
||||
|
@ -97,8 +97,9 @@ class Editor {
|
||||
|
||||
public async save(): Promise<void> {
|
||||
if (this.#filename === '') {
|
||||
const filename = await this.prompt('Save as: ');
|
||||
const filename = await this.prompt('Save as: %s (ESC to cancel)');
|
||||
if (filename === null) {
|
||||
this.setStatusMessage('Save aborted');
|
||||
return;
|
||||
}
|
||||
|
||||
@ -232,7 +233,12 @@ class Editor {
|
||||
let res = '';
|
||||
|
||||
outer: while (true) {
|
||||
if (p.includes('%s')) {
|
||||
this.setStatusMessage(p.replace('%s', res));
|
||||
} else {
|
||||
this.setStatusMessage(`${p}${res}`);
|
||||
}
|
||||
|
||||
await this.refreshScreen();
|
||||
for await (const chunk of term.inputLoop()) {
|
||||
const char = readKey(chunk);
|
||||
|
Loading…
Reference in New Issue
Block a user