feat!: deprecate rulerfmt/statfmt options (#2477)

* feat!: deprecate `rulerfmt`/`statfmt` options

These will be replaced with the ruler file (specified using the
`rulerfile` option).

* Add deprecation comments to involved functions

* Update `CHANGELOG.md`
This commit is contained in:
Joe Lim authored and GitHub committed 2026-03-31 15:23:28 +11:00
1 parent a966b1387c
commit 3db6242620
3 files changed
+6

No files matched your search

+1
View File
@@ -15,6 +15,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
- The key `<backspace2>` has been renamed to `<backspace>` for `map` keybindings (#2286).
- `.Stat.DirSize` and `.Stat.DirCount` in the ruler file no longer have a pointer type, and will be set to `-1` instead of `nil` if the corresponding value cannot be determined (#2397).
- `setlocal` commands no longer support the ability to specify recursive directories (#2415). For use cases where `setlocal` should apply to a directory based on some condition, it is recommended to script this inside the `on-load` hook command.
- The `rulerfmt` and `statfmt` options are now marked as deprecated in favor of using the ruler file (configured using the `rulerfile` option), and will be removed in a future release (#2477).
### Added
+2
View File
@@ -361,6 +361,7 @@ func (e *setExpr) eval(app *app, _ []string) {
gOpts.rulerfile = replaceTilde(e.val)
app.ui.ruler, app.ui.rulerErr = parseRuler(gOpts.rulerfile)
case "rulerfmt":
app.ui.echoerr("option 'rulerfmt' is deprecated and will be replaced by the 'rulerfile' option")
gOpts.rulerfmt = e.val
case "scrolloff":
n, err := strconv.Atoi(e.val)
@@ -418,6 +419,7 @@ func (e *setExpr) eval(app *app, _ []string) {
gOpts.sortby = method
app.nav.sort()
case "statfmt":
app.ui.echoerr("option 'statfmt' is deprecated and will be replaced by the 'rulerfile' option")
gOpts.statfmt = e.val
case "tabstop":
n, err := strconv.Atoi(e.val)
+3
View File
@@ -694,6 +694,7 @@ func (ui *ui) drawPromptLine(nav *nav) {
ui.promptWin.print(ui.screen, 0, 0, st, prompt)
}
// Deprecated: Only called by drawRuler, which will eventually be replaced by drawRulerFile
func formatRulerOpt(name, val string) string {
// handle escape character so it doesn't mess up the ruler
val = strings.ReplaceAll(val, "\033", "\033[7m\\033\033[0m")
@@ -706,6 +707,7 @@ func formatRulerOpt(name, val string) string {
return val
}
// Deprecated: Will eventually be replaced by drawRulerFile
func (ui *ui) drawStat(nav *nav) {
if ui.msg != "" {
ui.msgWin.print(ui.screen, 0, 0, tcell.StyleDefault, ui.msg)
@@ -756,6 +758,7 @@ func (ui *ui) drawStat(nav *nav) {
ui.msgWin.print(ui.screen, 0, 0, tcell.StyleDefault, fileInfo.String())
}
// Deprecated: Will eventually be replaced by drawRulerFile
func (ui *ui) drawRuler(nav *nav) {
st := tcell.StyleDefault