-
-
Notifications
You must be signed in to change notification settings - Fork 194
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
Prevent adding new whitespace when slurping forward/backward in OCaml and Latex #631
Conversation
Wow, this looks amazing on the first sight! Could I bother you to add test cases as well? You can inspire from the python mode test file. I'll try to review this ASAP. |
Sure! I just added a simple test cases for OCaml mode. Btw, I found out that the problem of adding more unwanted space could happen in many major modes, so fixing it by patching many modes are quite redundant (in my opinion). I believe the root cause for
If the first line is removed, and the second line is changed to How do you think about it? |
The space-adding code is there because of lisps, because something like Maybe if we make the number adjustable and change it in different modes, that might be helpful too. |
Thanks for the explanation! You are right about Given that
How do you think about it? |
So I'm dumb, and now we have PythonNut@cf36762, which is basically just the LaTeX portion of this, but applied to more pairs. |
@PythonNut do you want to provide it as a separate patch for now? I'll probably review this behaviour and try to come up with something universal for 1.10 release, but I would accept a temporary fix for now. |
@taquangtrung I rebased this branch on master and the tests are failing, can you check it out? https://travis-ci.org/Fuco1/smartparens/jobs/173359035 I would like to merge this before 1.9 is out :) |
Sure. Let me make a PR? |
I rebased and merged this, the issue was simple for me to fix on my own. Thanks for your contribution! |
Hi,
When using the excellent slurping feature, I encountered a problem in both OCaml and Latex. That is, a new whitespace is added when it is not supposed to:
For example: given a string
(foo) List.map
, I want to slurp forward to obtain(foo List.map)
,the current slurping forward adds a new space between
List.
andmap
as follow:The unwanted space should be removed, so that the expected behaviour is:
In these commits, I fixed the this problem for both forward and backward slurping, in major modes for OCaml and Latex.
Please fell free to merge them into your repository, if they are necessary.
Bests,
Trung.