Skip to content

Commit

Permalink
add editor command bottom-of-buffer-no-mark.
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchan0321 committed Aug 21, 2024
1 parent 8943e1e commit 9ac7c0a
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Tasklet/console-adjuster.prfm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ new Task : proc console-adjuster {

$MainWindow get-window-list-without-current : each do: {| w |
if [$w get-buffer : get-buffer-name : = "*Console*"] {
$w apply-command $MainWindow $w "" bottom-of-buffer;
$w apply-command $MainWindow $w "" bottom-of-buffer-no-mark;
SysCall update-screen;
};
};
Expand Down
23 changes: 23 additions & 0 deletions lib/pmacs-command-move.prfm
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,29 @@ defcommand bottom-of-buffer desc: "Move cursor to bottom of buffer." {
result SELF;
};

defcommand bottom-of-buffer-no-mark desc: "Move cursor to bottom of buffer no mark." {
| main window |
buff ::= $window get-buffer;
geom ::= $window get-geom;
(y x) ::= $window get-screen-size;
buff-len ::= $buff get-buffer-length;

$window set-freecursor <nil>;
$geom set! ViewLine 0;
$geom set! ViewColumn 0;
$geom set! CursorLine 0;
$geom set! CursorColumn 0;
$geom set! IndexColumn.SAVE 0;
if {$buff-len < $y} {
$geom set! CursorLine $buff-len;
} {
$geom set! ViewLine [$buff-len - $y : + 1];
$geom set! CursorLine [$y - 1];
};

result SELF;
};

defcommand fit-to-top desc: "Move current cursor position fit to window top edge and scroll up." {
| main window |
$window cursor-fit-to-top [$window get-geom];
Expand Down

0 comments on commit 9ac7c0a

Please sign in to comment.