Skip to content

status: Add option to show files as a directory tree - #1454

Open
wteuber wants to merge 2 commits into
jonas:masterfrom
wteuber:master
Open

wteuber wants to merge 2 commits into
jonas:masterfrom
wteuber:master

Conversation

@wteuber

@wteuber wteuber commented Sep 30, 2026

Copy link
Copy Markdown

Closes #1441

  • status: Bind 't' to toggle the directory tree layout

Bind 't' in the status view to :toggle status-tree, which also makes the toggle show up on the help page. The binding overrides the generic view-tree binding within the status view only.


  • Support drawing tree connectors before file names

Add a file_name_tree field to the view column data. When set, the file name column is prefixed with tree connectors rendered according to the line-graphics option, one 4-column cell per depth level. The automatic column width accounts for the connectors.

This is a preparation for showing the status view as a directory tree.

  • status: Read all files of a section before adding lines

Collect the parsed entries of a status section in an array and only add them to the view once the section has been read. This makes it possible to reorder the entries before displaying them, and has no visible effect on its own.

  • status: Add option to show files as a directory tree

Add the status-tree option, which is off by default. When enabled, the files of each status view section are shown as a directory tree similar to tree(1) instead of a flat list of paths. Directories are listed before files, and directories only containing a single subdirectory are collapsed into one line.

Directory lines can be staged or unstaged using status-update, which updates all files below the directory. Searching also matches the full path of files shown in the tree.

wteuber and others added 2 commits September 30, 2026 17:24
* Support drawing tree connectors before file names

Add a file_name_tree field to the view column data. When set, the file
name column is prefixed with tree connectors rendered according to the
line-graphics option, one 4-column cell per depth level. The automatic
column width accounts for the connectors.

This is a preparation for showing the status view as a directory tree.

* status: Read all files of a section before adding lines

Collect the parsed entries of a status section in an array and only add
them to the view once the section has been read. This makes it possible
to reorder the entries before displaying them, and has no visible effect
on its own.

* status: Add option to show files as a directory tree

Add the status-tree option, which is off by default. When enabled, the
files of each status view section are shown as a directory tree similar
to tree(1) instead of a flat list of paths. Directories are listed
before files, and directories only containing a single subdirectory are
collapsed into one line.

Directory lines can be staged or unstaged using status-update, which
updates all files below the directory. Searching also matches the full
path of files shown in the tree.

Closes jonas#1441

* status: Bind 't' to toggle the directory tree layout

Bind 't' in the status view to `:toggle status-tree`, which also makes
the toggle show up on the help page. The binding overrides the generic
view-tree binding within the status view only.
When the stage view is open, moving to the next or previous file moves
the cursor in the status view and shows the diff of the new line.
Directory lines of the status tree have no diff, so the stage view kept
showing the previous file. Skip directory lines in this case.

Also mention in NEWS that 't' no longer opens the tree view from the
status view.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: tree-style layout for status view (S)

1 participant