Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Changelog.org
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*** Added ~treemacs-buffer-name-function~
*** Added ~treemacs-file-follow-ignore-functions~
*** Added ~treemacs-buffer-name-prefix~
*** Added ~treemacs-hide-dot-jj-directory~
** v3.1
- Deprecated ~treemacs-window-background-color~ in favour of ~treemacs-window-background-face~ and
~treemacs-hl-line-face~
Expand Down
2 changes: 2 additions & 0 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,7 @@ discoverability.
treemacs-goto-tag-strategy 'refetch-index
treemacs-header-scroll-indicators '(nil . "^^^^^^")
treemacs-hide-dot-git-directory t
treemacs-hide-dot-jj-directory t
treemacs-indentation 2
treemacs-indentation-string " "
treemacs-is-never-other-window nil
Expand Down Expand Up @@ -641,6 +642,7 @@ Treemacs offers the following configuration options (~describe-variable~ will us
| treemacs-find-workspace-method | 'find-for-file-or-pick-first | Determines how treemacs selects the workspace when it first starts. |
| treemacs-header-scroll-indicators | '(nil . "^^^^^^") | Indicators used for ~treemacs-indicate-top-scroll-mode~. |
| treemacs-hide-dot-git-directory | t | Indicates whether ~.git~ directories should always be hidden. |
| treemacs-hide-dot-jj-directory | t | Indicates whether ~.jj~ directories should always be hidden. |
| treemacs-project-follow-into-home | nil | Indicates whether ~treemacs-project-follow-mode~ can follow into the $HOME directory. |
| treemacs-move-files-by-mouse-dragging | t | When non-nil treemacs will move files by dragging with your mouse inside treemacs. |
| treemacs-buffer-name-function | #'treemacs-default-buffer-name | Determines the names of treemacs buffers. |
Expand Down
5 changes: 4 additions & 1 deletion src/elisp/treemacs-core-utils.el
Original file line number Diff line number Diff line change
Expand Up @@ -1034,7 +1034,8 @@ Will return t when FILE
3) ends with \"~\" (backup files)
4) is surrounded with \"#\" (auto save files)
5) is \".git\" (see also `treemacs-hide-dot-git-directory')
6) is \".\" or \"..\" (default dirs)"
6) is \".jj\" (see also `treemacs-hide-dot-jj-directory')
7) is \".\" or \"..\" (default dirs)"
(declare (side-effect-free t) (pure t))
(inline-letevals (file)
(inline-quote
Expand All @@ -1046,6 +1047,8 @@ Will return t when FILE
(string-equal ,file "..")
(and treemacs-hide-dot-git-directory
(string-equal ,file ".git"))
(and treemacs-hide-dot-jj-directory
(string-equal ,file ".jj"))
(string-prefix-p "flycheck_" ,file))))))

(define-inline treemacs--mac-ignore-file-predicate (file _)
Expand Down
7 changes: 7 additions & 0 deletions src/elisp/treemacs-customization.el
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,13 @@ of `treemacs-toggle-show-dotfiles'."
:type 'boolean
:group 'treemacs)

(defcustom treemacs-hide-dot-jj-directory t
"Indicates whether the .jj directory should be hidden.
When this is non-nil the .jj dir will be hidden regardless of current setting
of `treemacs-toggle-show-dotfiles'."
:type 'boolean
:group 'treemacs)

(defcustom treemacs-sorting 'alphabetic-asc
"Indicates how treemacs will sort its files and directories.
Files will still always be shown after directories.
Expand Down
9 changes: 8 additions & 1 deletion test/treemacs-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,11 @@

(it "Accepts .git when it is not hidden"
(-let [treemacs-hide-dot-git-directory nil]
(expect (treemacs--reject-ignored-files "~/A/B/C/.git") :to-be t))))
(expect (treemacs--reject-ignored-files "~/A/B/C/.git") :to-be t)))

(it "Accepts .jj when it is not hidden"
(-let [treemacs-hide-dot-jj-directory nil]
(expect (treemacs--reject-ignored-files "~/A/B/C/.jj") :to-be t))))

(describe "Rejecting"

Expand Down Expand Up @@ -229,6 +233,9 @@
(it "Rejects .git"
(expect (treemacs--reject-ignored-and-dotfiles "~/A/B/C/.git") :to-be nil))

(it "Rejects .jj"
(expect (treemacs--reject-ignored-and-dotfiles "~/A/B/C/.jj") :to-be nil))

(it "Rejects dot"
(expect (treemacs--reject-ignored-and-dotfiles ".") :to-be nil))

Expand Down