bounceballview icon indicating copy to clipboard operation
bounceballview copied to clipboard

cancel问题

Open ddy-ding opened this issue 2 years ago • 0 comments

调用cancel()方法的时候闪退

ddy-ding avatar Aug 08 '22 14:08 ddy-ding

This will be an interesting puzzle to solve (I myself don't have enough time on a computer to solve it, these days).

There is a complex interrelationship between the parts involved. One avenue would be to disable the "Rainbow Parens" part of detailed.vim and see if that fixes the behavior. I had trouble with it interacting with rails.vim and had to shim its loading in at just the right time. I had a conversation with tpope about it, and he seemed hesitant to adjust anything in rails.vim since the whole load sequence was painful to get right to begin with.

I do not mean this to sound like a warning to stay away from it - by all means, anyone can dive and and figure this out - but only as a heads-up that this will require tinkering.

If you come up with something that works just go for it, and we can sort out side effects later.

rking avatar Jul 16 '13 16:07 rking

I'm beginning to dig into this a little, and I'll put notes from my exploration here, in case anyone else wants to follow me. I'm working with a small test file that looks like this:

foo("thing thang") do
  some.code((((("here do")))))
end

The extraneous nested parens are just to make it more obvious to me that the nesting is off. The first thing I tried was going to line 67 and commenting it out. Sure enough it turned the parens all the same color... but % didn't get fixed. Similarly, if I comment out both line 67 and the entire definition of fatpacked_rainbow_parens. I'm going to try binary searching this thing as a brute force method of testing. I don't expect it'll be pretty.

benhamill avatar Sep 07 '13 05:09 benhamill

Wow. I got lucky and seem to have narrowed it down right fast. It's line 743. If I comment this out, things seem OK. Seeing that the line said something about strings, I changed my test document to

foo("thing thang") do
  some.code((((("do")))))
end

foo("thing thang") do
  some.code(((((:do)))))
end

And, sure enough, the :do symbol doesn't confuse things whereas the "do" string does. Also, a 'do' string doesn't confuse things, either.

So. Interpolated strings it is. I don't know anything about vimscript, so the first thing I'm gonna learn is how to read this line, so I can figure out what it's actually about.

benhamill avatar Sep 07 '13 05:09 benhamill

More information: If the block is made of curly braces, it also gets confused:

foo("thing thang") {
  some.code((((("{")))))
}

I thought it might have something to do with the contains directive of the line, but when I changed it to NONE, it didn't seem to have an effect. I also experimented with removing the matchgroup directive and the skip directive. Neither had an effect.

benhamill avatar Sep 07 '13 07:09 benhamill

Well... I narrowed it some more. It has something to do with the group name being detailedInterpolatedString and not rubyString. When I changed the line to this:

  syn region rubyString matchgroup=detailedInterpolatedStringDelimiter start="\"" end="\"" skip="\\\\\|\\\"" contains=@rubyStringSpecial,@Spell fold

it works OK. I have no idea if this would have additional fallout, though, as far as altered behavior.

benhamill avatar Sep 07 '13 07:09 benhamill

Also, I just noticed that putting a do in there also confuses things, and since that's meant to be a different color from strings, generally, it becomes more clear what the fallout might be for the quick fix...

benhamill avatar Sep 07 '13 07:09 benhamill

There's the code that makes it "work". This isn't an actual fix. I'd love to see if this jogs any good ideas out of someone more experienced.

benhamill avatar Sep 07 '13 07:09 benhamill

@wwalker I haven't looked at this in ages, but I've learned a little bit about Vim syntax files since then. I don't really have an opinion about forks or not forks or whatever. Is @rking completely MIA? Like, if someone forked it, would they have to change the name in order to publish to vim scripts?

benhamill avatar Feb 24 '15 23:02 benhamill

I've not seen RKing or heard about him for nearly two years.

He lived here in Austin, so I actually saw with him a couple of times at ruby events

Could just start a similar project.

wwalker avatar Feb 24 '15 23:02 wwalker

Cool. I'm up for whatever. I have push access to this repo, so if you fork this, let me know, and I can make a big note at the top of the README that the new thing supersedes it.

benhamill avatar Mar 04 '15 07:03 benhamill