Closed fcrespo82 closed 8 years ago
Changing line 75 from editor.backwardScanInBufferRange(@regex, range, myIterator)
to editor.scanInBufferRange(@regex, range, myIterator)
seens to fix. But needs more tests.
This can be testes by checking out the ColumnAsFirstItem branch.
@lierdakil can you help me with that?
I will take a look. Bear in mind that I'm insanely busy right now, so it may take a day or two for me to get to this.
Don't worry. Take your time... I'm not in a rush and I find it rather difficult to someone use a table as the first thing in the document.
On Tue, Dec 15, 2015 at 10:36 AM Nikolay Yakimov notifications@github.com wrote:
I will take a look. Bear in mind that I'm insanely busy right now, so it may take a day or two for me to get to this.
— Reply to this email directly or view it on GitHub https://github.com/fcrespo82/atom-markdown-table-formatter/issues/23#issuecomment-164751291 .
Fernando Xavier de Freitas Crespo
Looks like this goes deeper than our little package. I've opened an issue on Atom's repo. Let's see what Atom devs say first.
I thought that too. Because the ranges were being reported correctly. Let's see what they will say.
Fernando X. F. Crespo
Em 15 de dez de 2015, às 16:49, Nikolay Yakimov notifications@github.com escreveu:
Looks like this goes deeper than our little package. I've opened an issue on Atom's repo. Let's see what Atom devs say first.
— Reply to this email directly or view it on GitHub.
So, it's a bug in Atom core after all. Fix is available, and will likely get into next minor release. https://github.com/atom/text-buffer/pull/120
That said, we don't have to scan backwards, I don't think. I've changed testing code to provide more coverage (also to save some scrolling) and added more editor-specific tests. You can find it in editor-tests
branch. ColumnAsFirstItem
is merged into that one already.
@lierdakil you're great, thank you very much for your help. There's some sense of achievement finding a bug in such a great product as Atom.
I thought we should use backwards scan not to mess with marker positions after inserting the formatting spaces, but appears as Atom already takes care of this.
Closed by #25
is formatted as
It appears that when then table is the first thing in the document that the
myIterator
runs twice.