fix(org): tab not invoking cdlatex-tab in headings
In org-mode, if one writes a math expression in a section (i.e. heading) while using cdlatex, pressing tab indents the section instead of performing a cdlatex-tab. This fix takes care of this issue to have the wanted behavior: if in math environment and hit tab while in section, execute cdlatex-tab. Close: #5926 Co-authored-by: roiholtzman <roiholtzman@users.noreply.github.com>
This commit is contained in:
parent
b37d8481ce
commit
67a9573f0d
1 changed files with 8 additions and 1 deletions
|
@ -375,6 +375,10 @@ Made for `org-tab-first-hook' in evil-mode."
|
|||
(cond ((not (and (bound-and-true-p evil-local-mode)
|
||||
(evil-insert-state-p)))
|
||||
nil)
|
||||
((and (bound-and-true-p org-cdlatex-mode)
|
||||
(or (org-inside-LaTeX-fragment-p)
|
||||
(org-inside-latex-macro-p)))
|
||||
nil)
|
||||
((org-at-item-p)
|
||||
(if (eq this-command 'org-shifttab)
|
||||
(org-outdent-item-tree)
|
||||
|
@ -441,7 +445,10 @@ of the time I just want to peek into the current subtree -- at most, expand
|
|||
All my (performant) foldings needs are met between this and `org-show-subtree'
|
||||
(on zO for evil users), and `org-cycle' on shift-TAB if I need it."
|
||||
(interactive "P")
|
||||
(unless (eq this-command 'org-shifttab)
|
||||
(unless (or (eq this-command 'org-shifttab)
|
||||
(and (bound-and-true-p org-cdlatex-mode)
|
||||
(or (org-inside-LaTeX-fragment-p)
|
||||
(org-inside-latex-macro-p))))
|
||||
(save-excursion
|
||||
(org-beginning-of-line)
|
||||
(let (invisible-p)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue