From 541712d4e9bb12403344ba4db7158ffe7c2f6aaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kirill=20M=C3=BCller?= Date: Sat, 30 Apr 2022 17:46:05 +0200 Subject: [PATCH] Show focus columns in header --- R/tbl-format-header.R | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/R/tbl-format-header.R b/R/tbl-format-header.R index f8ae970bb..745c2d593 100644 --- a/R/tbl-format-header.R +++ b/R/tbl-format-header.R @@ -33,6 +33,10 @@ tbl_format_header <- function(x, setup, ...) { #' @export tbl_format_header.tbl <- function(x, setup, ...) { named_header <- setup$tbl_sum + focus <- attr(x, "pillar_focus") + if (!is.null(focus)) { + named_header <- c(named_header, "Focus columns" = collapse(tick_if_needed(focus))) + } if (all(names2(named_header) == "")) { header <- named_header