diff --git a/CHANGELOG.md b/CHANGELOG.md index c5696c0d0..18bbc9752 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -55,6 +55,9 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). * `jj absorb` can now squash a deleted file if it was added by one of the destination revisions. +* Added `ui.streampager.show-ruler` setting to configure whether the ruler should be + shown when the builtin pager starts up. + ### Fixed bugs * Fixed crash on change-delete conflict resolution. diff --git a/cli/src/config-schema.json b/cli/src/config-schema.json index ce01450bd..c7e7939d9 100644 --- a/cli/src/config-schema.json +++ b/cli/src/config-schema.json @@ -141,6 +141,11 @@ "none" ], "default": "anywhere" + }, + "show-ruler": { + "type": "boolean", + "description": "Whether the ruler should start visible", + "default": true } } }, diff --git a/cli/src/config/misc.toml b/cli/src/config/misc.toml index 3178dc10f..b5407d175 100644 --- a/cli/src/config/misc.toml +++ b/cli/src/config/misc.toml @@ -43,6 +43,7 @@ edit = false [ui.streampager] interface = "quit-if-one-page" wrapping = "anywhere" +show-ruler = true [snapshot] max-new-file-size = "1MiB" diff --git a/cli/src/ui.rs b/cli/src/ui.rs index ae57e20fb..5cc47a231 100644 --- a/cli/src/ui.rs +++ b/cli/src/ui.rs @@ -83,6 +83,7 @@ impl UiOutput { let streampager_config = streampager::config::Config { wrapping_mode: config.wrapping.into(), interface_mode: config.streampager_interface_mode(), + show_ruler: config.show_ruler, // We could make scroll-past-eof configurable, but I'm guessing people // will not miss it. If we do make it configurable, we should mention // that it's a bad idea to turn this on if `interface=quit-if-one-page`, @@ -297,6 +298,7 @@ impl From for streampager::config::WrappingMode { struct StreampagerConfig { interface: StreampagerAlternateScreenMode, wrapping: StreampagerWrappingMode, + show_ruler: bool, // TODO: Add an `quit-quickly-delay-seconds` floating point option or a // `quit-quickly-delay` option that takes a 's' or 'ms' suffix. Note that as // of this writing, floating point numbers do not work with `--config` diff --git a/docs/config.md b/docs/config.md index 0b9903dc9..1837da446 100644 --- a/docs/config.md +++ b/docs/config.md @@ -763,6 +763,16 @@ interface = "full-screen-clear-output" interface = "quit-quickly-or-clear-output" ``` +#### Showing the ruler on startup + +```toml +[ui.streampager] +# Start with the ruler showing +show-ruler = true # (default) +# Start with the ruler hidden +show-ruler = false +``` + ### Processing contents to be paged