expez / evil-smartparens

Evil integration for Smartparens
GNU General Public License v3.0
134 stars 17 forks source link

Fix indent-according-to-mode usage #33

Closed andyleejordan closed 8 years ago

andyleejordan commented 8 years ago

This fixes #30. In general we should not attempt to call this as it can have unexpected side-effects (like moving the point and shifting the whole-line when not desired).

This re-fixes #12 but without calling an indentation function.

The behavior is as close as I can get to what I think is desired in all the cases. However, there is a minor annoyance that dd and cc still move the point to the beginning of the line in the cases outlined in #12; however the indentation is unaffected. If we can fix that, I'd say this is perfect. Regardless, it's a major improvement on the current behavior.

This passed make test's 38 tests. But please manually test edge cases to see if anything was missed, and it'd be awesome if I could get some help solving the point-move problem.

expez commented 8 years ago

Thanks for getting your hands dirty!

I'll apply the patch manually and try it out for a few days to look for edge-cases.

andyleejordan commented 8 years ago

Thanks for dog-fooding @expez. Please do let me know if you figure out the cursor movement issue. I was debugging and it certainly appears to me that dd and cc move the cursor to the start of the line before evil-sp-delete and evil-sp-change are even called.

andyleejordan commented 8 years ago

@expez Any luck?

expez commented 8 years ago

Sorry about that @andschwa, I just put this in my .emacs and forgot about it :) Atleast it's well-tested by now!

As to the cursor issue, I reached the same conclusion you did. I don't want to reach into evil's internals so we'll just have to live with this, I think.

Thanks again! 👍

andyleejordan commented 8 years ago

Glad to hear it! Thanks for the merge :smile: