Skip to content

Commit

Permalink
[Mouse] Ensure right-click menu is usable with context-menu-mode.
Browse files Browse the repository at this point in the history
Fixes #909
  • Loading branch information
Alexander-Miller committed Aug 22, 2023
1 parent 76a20a4 commit 147594c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/elisp/treemacs-compatibility.el
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,12 @@ width of the new window when the treemacs window is visible."
(when (and (boundp 'evil-escape-excluded-major-modes) (not (boundp 'evil-escape-version)))
(add-to-list 'evil-escape-excluded-major-modes 'treemacs-mode)))

(when (fboundp 'context-menu-mode)
(defun treemacs--disable-context-menu-mode ()
(treemacs-run-in-all-derived-buffers
(setq-local context-menu-functions nil)))
(add-hook 'context-menu-mode-hook 'treemacs--disable-context-menu-mode))

(defun treemacs-load-all-the-icons-with-workaround-font (font)
"Load the `treemacs-all-the-icons' package using a workaround FONT for tabs.
Use this if you experience the issue of icons jumping around when they are
Expand Down
2 changes: 2 additions & 0 deletions src/elisp/treemacs-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,8 @@ Will simply return `treemacs--eldoc-msg'."
(setq-local eldoc-documentation-function #'treemacs--eldoc-function)
(setq-local eldoc-message-commands treemacs--eldoc-obarray)
(setq-local imenu-create-index-function #'treemacs--create-imenu-index-function)
(setq-local context-menu-functions nil)

;; integrate with bookmark.el
(setq-local bookmark-make-record-function #'treemacs--make-bookmark-record)
(electric-indent-local-mode -1)
Expand Down

0 comments on commit 147594c

Please sign in to comment.