чување f32bd0bf3211727e91faa24741d95607a8531056
родитељ b3555e6decf8464d6fdd6ab5d825093bbf6f5313
Аутор: Страхиња Радић <sr@strahinja.org>
Датум: Mon, 6 Oct 2025 09:39:04 +0200
ste.in: Decrease the total number of rows in the prompt
Diffstat:
измењених датотека: 3, додавања: 6(+), брисања: 6(-)
diff --git a/TODO b/TODO
@@ -1,10 +1,6 @@
TODO
====
-[x] Bugfix: pressing enter errors out with "shift: nothing to shift"
-
-[ ] Decrease the total number of rows in the prompt
-
< > Column paging?
< > Command to insert/delete a column?
diff --git a/TODO.done b/TODO.done
@@ -1,6 +1,10 @@
Done todos
==========
+[x] Bugfix: pressing enter errors out with "shift: nothing to shift"
+
+[x] Decrease the total number of rows in the prompt
+
[/] Bugfix: closing the editor after the insert command (effectively cancelling
it) should not insert an empty row
- Is this a bug at all? This looks more like a matter of policy. For
diff --git a/ste.in b/ste.in
@@ -280,7 +280,7 @@ directly from stdin"
#shellcheck disable=SC2016,SC2140
cmd=$(rlwrap -H "$historyfile" -s 1000 -D 2 -I -o \
-S "${file##*/}[${_cols}x${_rows}+${firstrow}"\
-"@${currow}/${maxrows}]> " sh -c 'IFS= read -r CMD && printf "%s\n" "$CMD"')
+"@${currow}/$((maxrows-1))]> " sh -c 'IFS= read -r CMD && printf "%s\n" "$CMD"')
#shellcheck disable=SC2181
if [ "$?" -ne 0 ]; then
cmd="exit"
@@ -288,7 +288,7 @@ directly from stdin"
else
printf "%s[%dx%d+%d@%d/%d]> " \
"${file##*/}" "$_cols" "$_rows" "$firstrow" \
- "$currow" "$maxrows"
+ "$currow" "$((maxrows-1))"
IFS= read -r cmd
fi
else