Standard PageUp / PageDownMakes PageUp/PageDown scroll by one page while keeping the cursor at the same position on the screen (the same row from the top), like Visual Studio, Sublime Text, and JetBrains IDEs. Rewritten from scratch based on the idea of russelldavis/vscode-better-pageup-pagedown by Russell Davis (MIT License). This is a modified version, not the original extension published by its author. Behavior
Command names are shown in English or Japanese according to the VS Code display language. Changes from the original extensionThe original extension simply ran the standard "scroll one page" and "move cursor one page" commands in a row, so near the end or beginning of the document only the scrolling stopped and the cursor's on-screen position shifted. This version calculates the destination itself, decides the visible range, and then moves the cursor. LimitationsLines are counted as logical lines. Lines with a lot of word wrapping, or folded regions, may make the page size or on-screen position slightly off (the VS Code extension API does not provide the exact number of wrapped display lines). 日本語PageUp/PageDown で、カーソルの画面上の位置(上から何行目か)を保ったまま 1 ページ分スクロールする拡張機能。Visual Studio、Sublime Text、JetBrains 系 IDE と同じ操作感になる。 Russell Davis 氏の russelldavis/vscode-better-pageup-pagedown(MIT License)の考え方をもとに、コードを一から書き直したもの。元の作者が公開している拡張そのものではなく、それを改変したバージョンである。 動作
コマンド名は、VS Code の表示言語に合わせて日本語か英語で表示する。 元の拡張からの変更点元の拡張は「標準の 1 ページスクロール」と「標準の 1 ページカーソル移動」を続けて実行するだけだったため、文書の末尾や先頭付近ではスクロールだけが止まり、カーソルの画面上の位置がずれていた。この版は移動先を自分で計算し、表示位置を決めてからカーソルを動かす。 制限行数の計算は論理行単位で行っている。そのため、折り返し表示が多い行や折りたたみがあると、1 ページの移動量や画面上の位置が少しずれることがある(VS Code の拡張 API からは、折り返し後の表示行数を正確に得られないため)。 |