Code Monkey home page Code Monkey logo

Comments (4)

immerrr avatar immerrr commented on June 10, 2024

Hi and thanks for the report. I'll see to it.

It would help, though, to have complete sequence of actions from startup (emacs -q -l lua-mode.el) to the point of failure.

from lua-mode.

ineu avatar ineu commented on June 10, 2024

Hi immerrr. Thanks for response.
How to reproduce:

  1. emacs -q -l lua-mode.el
  2. C-x b foo
  3. M-x lua-mode
  4. M-x electric-pair-mode
  5. C-h v electic-pair-skip-self ; should be true by default, if no, set it
  6. Type ( ; closing paren is automatically inserted
  7. Type ) ; should move forward skipping autoinserted paren, but instead it adds another one.

Try 4-7 in c-mode or ruby-mode to see how it works.
Thanks.

from lua-mode.

npostavs avatar npostavs commented on June 10, 2024

Hi, it looks like the problem is that lua-electric-match calls insert-char directly, but electric-pair-mode hooks self-insert-command. Seems to be fixed by

diff --git a/lua-mode.el b/lua-mode.el
index 08862ec..934d31b 100644
--- a/lua-mode.el
+++ b/lua-mode.el
@@ -710,7 +710,7 @@ Groups 6-9 can be used in any of argument regexps."
 (defun lua-electric-match (arg)
   "Insert character and adjust indentation."
   (interactive "P")
-  (insert-char last-command-event (prefix-numeric-value arg))
+  (self-insert-command (prefix-numeric-value arg))
   (if lua-electric-flag
       (lua-indent-line))
   (blink-matching-open))

Although I guess lua-electric-match would be redundant altogether if eletric-pair-mode and electric-indent-mode are both enabled.

from lua-mode.

immerrr avatar immerrr commented on June 10, 2024

Should work now. Special thanks go to @npostavs for providing a solution.

from lua-mode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.