Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jump to end when current line has a "if" keyword in web-mode and html-mode #119

Closed
jadestrong opened this issue Mar 25, 2020 · 4 comments
Closed

Comments

@jadestrong
Copy link

'(("if" ("elseif" "else") "endif" "MONOGAMY")

A test.html like this:

<!doctype html>
<html class="no-js" lang="">
  <body>
    <script>
      function () {
        if (true) { <-------cursor here
          console.log('hello world');
        }
      }
    </script>
  </body>
</html>

because the line has a if keyword, so it use evilmi-template-get-tag parse it, but it is not a html tag, should use evilmi-simple-get-tag.
debug info:

evilmi--operate-on-item called => nil (point)=106
major-mode: html-mode
plugin: ((evilmi-template-get-tag evilmi-template-jump) (evilmi-simple-get-tag evilmi-simple-jump) (evilmi-html-get-tag evilmi-html-jump))
evilmi-sdk-member called => if (if (elseif else) endif MONOGAMY). rlt=0
evilmi-sdk-member called => if ((if (elseif else) endif MONOGAMY) (foreach nil endforeach MONOGAMY) (for nil endfor MONOGAMY) (while nil endwhile MONOGAMY) (@section nil (@show @stop @overwrite) MONOGAMY) (@if (@elseif @else) @endif MONOGAMY) (@unless nil @endunless) (@for nil @endfor MONOGAMY) (@foreach nil @endforeach MONOGAMY) (@forelse @empty @endforelse MONOGAMY) (@while nil @endwhile MONOGAMY)). rlt=0
evilmi-sdk-member called => if if. rlt=0
evilmi-sdk-get-tag-info called => if ((if (elseif else) endif MONOGAMY) (foreach nil endforeach MONOGAMY) (for nil endfor MONOGAMY) (while nil endwhile MONOGAMY) (@section nil (@show @stop @overwrite) MONOGAMY) (@if (@elseif @else) @endif MONOGAMY) (@unless nil @endunless) (@for nil @endfor MONOGAMY) (@foreach nil @endforeach MONOGAMY) (@forelse @empty @endforelse MONOGAMY) (@while nil @endwhile MONOGAMY)). rlt=(0 0 MONOGAMY if)
elem: (evilmi-template-get-tag evilmi-template-jump)
evilmi-sdk-jump called => rlt=(88 (0 0 MONOGAMY if)) (point)=106
keyword=nil cur-line=          console.log('hello world');
keyword=nil cur-line=        }
keyword=nil cur-line=      }
keyword=nil cur-line=    </script>
keyword=nil cur-line=
keyword=nil cur-line=  </body>
keyword=nil cur-line=</html>
keyword=nil cur-line=
evilmi--get-char-under-cursor called. Return: (0 197)
evilmi-simple-get-tag called => ch=0 (point)=197
evilmi--simple-find-open-brace called => cur-line= (point)=197
funcall: End of buffer
@redguardtoo
Copy link
Owner

redguardtoo commented Mar 25, 2020

Use (evilmi-load-plugin-rules '(web-mode) '(simple template html)) adjust the rule's priority

@jadestrong
Copy link
Author

Thanks, It works as expect. Is there any other problem with this adjust in web-mode?

@redguardtoo
Copy link
Owner

I can't see any problem.

@jadestrong
Copy link
Author

OK.

duianto added a commit to duianto/spacemacs that referenced this issue Jul 20, 2021
problem
With the cursor on a parenthesis in js code in a .html document,
pressing:
```
%                      ;; evilmi-jump-items
```
jumps to the buffers last line.

solution from upstream issue
Jump to end when current line has a "if" keyword in web-mode and html-mode
redguardtoo/evil-matchit#119
lebensterben pushed a commit to syl20bnr/spacemacs that referenced this issue Jul 22, 2021
problem
With the cursor on a parenthesis in js code in a .html document,
pressing:
```
%                      ;; evilmi-jump-items
```
jumps to the buffers last line.

solution from upstream issue
Jump to end when current line has a "if" keyword in web-mode and html-mode
redguardtoo/evil-matchit#119
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

No branches or pull requests

2 participants