Hello,
I am working around in the code, and I was trying to determine where the row iterator object used in layout.cc is defined so I might study it’s properties? Could anyone point me in the right direction? Much appreciated.
Josh
On 2016-05-20 06:01, Joshua Bernitt wrote:
Hello,
I am working around in the code, and I was trying to determine where the row iterator object used in layout.cc is defined so I might study it’s properties? Could anyone point me in the right direction? Much appreciated.
_rows is declared in layout.h with the type "row_tree_t". row_tree_t is declared in the same file as "oak::basic_tree_t<row_key_t, paragraph_t> ". basic_tree_t is actually mentioned in INTERNALS.md. basic_tree_t is declared in Shared/include/oak/basic_tree.h, there's an iterator declared in the same file.
Hope that answers your question.
Yes, that helps! Thank you!
On 5/20/16, 3:06 AM, "Jacob Carlborg" <textmate-bounces+jjbernitt=gmail.com@lists.macromates.com on behalf of doob@me.com> wrote:
On 2016-05-20 06:01, Joshua Bernitt wrote:
Hello,
I am working around in the code, and I was trying to determine where the row iterator object used in layout.cc is defined so I might study it’s properties? Could anyone point me in the right direction? Much appreciated.
_rows is declared in layout.h with the type "row_tree_t". row_tree_t is declared in the same file as "oak::basic_tree_t<row_key_t, paragraph_t> ". basic_tree_t is actually mentioned in INTERNALS.md. basic_tree_t is declared in Shared/include/oak/basic_tree.h, there's an iterator declared in the same file.
Hope that answers your question.
-- /Jacob Carlborg
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
I’ve been digging around more in the effort to “pretty print” the indent guides, and my current plan (based on what I’ve seen) is to iterate over each row in the editor parse each row and search for levels of indentation draw the indent guide up to the highest level of indentation I don’t know of a different way to “pretty print” since each indent guide is determined by the current indent level at a row. If you have a better idea, please let me know.
As far as parsing goes, I haven’t seen anything specific that will automatically pull in a line up until ‘\n’. Is that correct, or did I miss a function somewhere? From what I see, I need to use the row iterator to pull each line from the buffer object, then use something in the text/ framework to parse each line?
Thank you for the guidance! -- Josh Bernitt Sent with Airmail
On May 20, 2016 at 7:47:40 AM, Joshua Bernitt (jjbernitt@gmail.com) wrote:
Yes, that helps! Thank you!
On 5/20/16, 3:06 AM, "Jacob Carlborg" <textmate-bounces+jjbernitt=gmail.com@lists.macromates.com on behalf of doob@me.com> wrote:
On 2016-05-20 06:01, Joshua Bernitt wrote:
Hello, I am working around in the code, and I was trying to determine where the row iterator object used in layout.cc is defined so I might study it’s properties? Could anyone point me in the right direction? Much appreciated.
_rows is declared in layout.h with the type "row_tree_t". row_tree_t is declared in the same file as "oak::basic_tree_t<row_key_t, paragraph_t> ". basic_tree_t is actually mentioned in INTERNALS.md. basic_tree_t is declared in Shared/include/oak/basic_tree.h, there's an iterator declared in the same file. Hope that answers your question. -- /Jacob Carlborg _______________________________________________ textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
On 2016-05-27 13:24, Josh Bernitt wrote:
I’ve been digging around more in the effort to “pretty print” the indent guides, and my current plan (based on what I’ve seen) is to
- iterate over each row in the editor
- parse each row and search for levels of indentation
- draw the indent guide up to the highest level of indentation
I don’t know of a different way to “pretty print” since each indent guide is determined by the current indent level at a row. If you have a better idea, please let me know.
Sounds right to me.
As far as parsing goes, I haven’t seen anything specific that will automatically pull in a line up until ‘\n’. Is that correct, or did I miss a function somewhere? From what I see, I need to use the row iterator to pull each line from the buffer object, then use something in the text/ framework to parse each line?
There's already a loop that iterates each row and draws the text for that row [1]. I guess you can add the indent guide drawing code to that loop.
I'm guessing you need to parse each line looking for the first non whitespace character and count the number of indentations up to that character. You need to know the indentation setting, i.e. tab or space and how many spaces. I don't think you need to worry about any Unicode because what you'll be looking for is in the ASCII table.
[1] https://github.com/textmate/textmate/blob/master/Frameworks/layout/src/layou...