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
Add indent
option
#23
Comments
Can you show an example of what you're thinking? |
I modified your code slightly to add: this.column = 0 and this.stream.cursorTo(this.column); This allowed me to something like this: spinner.text = "Templating files";
spinner.stopAndPersist(figures.arrowRight);
spinner.column += 4;
// the functions template_test and template_nativeloop set spinner text
// and call succeed() when done.
return Promise.all(_.map(['test.xml'], template_test))
.then(() => Promise.all(_.map(['readme.md'], template_nativeloop)))
.then(() => {
spinner.column -= 4;
return true;
}); Giving me this result:
As a side note, I am also modifying it to add a function that accepts a title and promise (and then returns a promise). Not sure if that fits in w/ your vision for support for promises though... |
I like it 😄 I'm cool with implementing it if @sindresorhus is ok with it – or to accept a PR if you would send it |
I added PR: #24 |
That looks a lot like listr. |
It does :) I really like listr but behaviors like deleting all completed sub-tasks, don't fit my requirements. Using ora out-of-the box works very well and is actually a lot less coding. As soon as I finish adding Promises to ora, it will be even better! |
No problem. I am refactoring the renderer part however which will let devs plugin their custom renderer. Keeping completed subtasks was asked for in the issue tracker. |
I saw that. I tried modifying the listr code but every change I made seemed to make things worse. Definitely place the blame for that on me and not on listr! |
Hehe :). I hope to ship the custom renderer part one of the following days. This will remove all the render related stuff from the tasks and let the renderer handle it. Hope to make things a little bit cleaner with this and add more renderers like this one and a verbose one. Will let you know when it is resolved. Although I'm not keeping you from implementing it on your own ;). |
I will definitely use listr again! I am just making the ora output look like listr right now but not actually trying to recreate listr. My current code fits the purpose of what I was trying to accomplish but isn't reusable in any way. I hate when I have that... |
Listr now ships with custom renderers. The default renderer (listr-update-renderer) now also has the |
indent
option
For cross-reference, PR at #41 |
@SamVerschueren - I know this is an old request and this feature seems unlikely to ever get into ora. I did try listr and the indent works but because the collapse=false feature doesn't work, it shows but then disappears. |
@issuehuntfest has funded $40.00 to this issue. See it on IssueHunt |
@sindresorhus has rewarded $28.00 to @yaodingyd. See it on IssueHunt
|
It would be nice to be able to control what is set to cursorTo in order to support indentation of rows, if desired.
The text was updated successfully, but these errors were encountered: