emacs-evil / evil-surround

you will be surrounded (surround.vim for evil, the extensible vi layer)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Why did you revert the commit enabling lexical binding?

LemonBreezes opened this issue · comments

Just curious. The only line that seems like it may cause problems with the lexical binding to me is the

(pair (or (and (boundp 'pair) pair) (evil-surround-pair char)))

line because you are checking if a lexically scoped variable is bound, which will always return nil under a lexical binding unless pair is defined globally.

So if a bug occured, I would recommend just doing (defvar pair nil) to see if it goes away, then change the variable name accordingly.

@LemonBreezes details are here: #187
Thanks for nudging though - this is something I've dropped and never picked back up. I'll try to look when I have a minute.

@LemonBreezes details are here: #187
Thanks for nudging though - this is something I've dropped and never picked back up. I'll try to look when I have a minute.

Yup! That looks pretty much like what I observed. Replacing pair with a global variable does the trick.

If you'd like to make a PR (including @leungbk 's original commits), I'll happily merge.