Skip to content

Commit

Permalink
Add support for outline/outshine headings with verilog-ext-tab
Browse files Browse the repository at this point in the history
  • Loading branch information
gmlarumbe committed Dec 5, 2024
1 parent b7618b3 commit ca8713c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion verilog-ext-utils.el
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

(require 'verilog-mode)
(require 'verilog-ts-mode)
(require 'outline)

;;;; Custom
(defcustom verilog-ext-file-extension-re "\\.s?vh?\\'"
Expand Down Expand Up @@ -856,13 +857,17 @@ Pass the args START, END and optional COLUMN to `indent-region'."
(defun verilog-ext-tab (&optional arg)
"Run corresponding TAB function depending on `major-mode'.
If on an outline header, fold/unfold current section (`outshine' compatibility).
If on a `verilog-mode' buffer, run `electric-verilog-tab' with original
`verilog-mode' syntax table. Prevents indentation issues with compiler
directives with a modified syntax table.
If on a `verilog-ts-mode' buffer, run `indent-for-tab-command' with ARG."
(interactive "P")
(cond ((eq major-mode 'verilog-mode)
(cond ((outline-on-heading-p)
(outline-cycle))
((eq major-mode 'verilog-mode)
(verilog-ext-with-syntax-table-tick-word
(electric-verilog-tab)))
((eq major-mode 'verilog-ts-mode)
Expand Down

0 comments on commit ca8713c

Please sign in to comment.