-
Notifications
You must be signed in to change notification settings - Fork 513
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
Modularize files and functions #92
Modularize files and functions #92
Conversation
…d font' with function calls
…lly trample on a user's environment variables
…nd change the names in preparation for extraction
…not setting colors
…ed out? Seems to me all items need an extra space on the right?
…s do the right thing (Adds a couple too many spaces on the right but we'll fix that in a second)
…oes not require a comment
Wow that's a major PR, I'm glad your helping out. It will take some time to apply (will do as soon as I can); exams in one week. Have not looked at the actual changes but from the description it sounds good. About themes and ui-print functios, issue #81 should take care of that in a not to distance future (but might still pull in changes since it's better than the current state:)) |
Yeah sorry for what ended up being a complete rewrite, I didn't mean for it to be this large of a PR. I had planned on making some simple changes, then those changes required other changes, etc, etc. I think having a common codebase for Powerline segments would be a huge win. I had actually considered using Ruby or Python instead of Bash. It would make the code much cleaner, but I didn't want to add the extra dependency without asking first. In the end, I think the code after the PR gets us most of the way there. Additionally, there are only two places in the code that even require Bash 4 now and we could probably use Bash 3 which would require no extra steps for 90% of the people out there. I run ZSH 4 as my primary shell and I have Bash 4 installed as well but not everyone does. |
This is awesome. 👍 We need this like yesterday. |
Indeed. I'll dedicate some time to this next weekend, after my finals :) |
I would love to have this. I'm actually waiting for this to be implemented in order to start using this. 😄 |
Working on it right now, done later today. https://github.com/erikw/tmux-powerline/tree/refactor |
Excellent, looking forward to it. Thanks! |
Now this is going to be awesome. Getting late now, 6pm Friday gtg :) I'll pick up the work tomorrow. https://github.com/erikw/tmux-powerline/commits/refactor |
Excellent, thanks! Have a nice weekend. 😉 |
@erikw I looked through all your commits. All of them look good to me with the exception of you converting all the spaces to tabs. What editor are you using that you need to use tabs instead of spaces? It causes serious problems when other people work on the code. A tab is not always the same for everyone. A space always is. |
Just as an example, look at how the diff looks on Github. Is this how it looks locally for you? I'd assume not. 363cc83 |
@jfelchner I think that's why a tab would be better, first it's only one character, second, it can be any width the user wants, so it's more user friendly I would say. That's my opinion. |
While tempted to argue, all there is to say about tabs vs spaces has been said and I've picked my side :-) |
@greduan, you'd think so, it sounds logical, but it never works out that way. Turning on "soft tabs" in your editor gives you all the flexibility of tabs with none of the downsides. For example, look at that diff I linked to in my previous comment, tabs were used there, but the indention looks awful. |
@erikw I didn't even know it was something that was up for debate. :) Tabs give you zero benefit over using "soft tabs". |
@jfelchner Have you not been on the Internet? ^^ here's a pick of blogs about it: Just Google "spaces vs tabs" and you'll find lots of weekend reading for both sides. I agree with @erikw in the use of tabs but an argument about this never really gets anywhere. There are good arguments for both sides so it's more constructive to agree on one to use in the project. Since @erikw is the owner of the repo I'd say he gets the last say. |
The tabs vs spaces discussion is fun, and let's face it: it's a holy war. Most arguments are frankly absurd (tabs saves disk space, OMG are we in 1990?), so I have to painfully agree with @meldanya and @greduan. It's up to the "team" to decide the coding style, since github is "person-centered" that is the repo owner. Maybe someday this project would belong to more than one person, then you (since I haven't contributed a single line of code) could discuss the coding style ❤️. I have looked at the refactor branch, and I see that most Jeff contributions got in ONE commit, shouldn't be better if you rebase it to have a cleaner history? (lol, another holy war) |
Oh snap trapstorm, seems like I missed the |
Personally, I like spaces over tabs but I agree that it should ultimately be up to the repo owner. |
It looks like the README needs to be updated on the refactor branch to show how to use the new code...? Is this something I can maybe help with? Thanks! |
Oh yeah the README needs a major update, forgot to put the refactor_TODO On Dec 15, 2012 8:39 AM, "David Davis" [email protected] wrote:
|
Holy crap. What did I start? :) My take is that if we only use tabs It's @erikw's repo and I'll bow to the consensus. :) But my reasoning for On Saturday, December 15, 2012, Pablo Olmos de Aguilera Corradini wrote:
|
OH! I didn't understand it like that, sorry. :P |
Woho finally done! Thanks a lot @jfelchner for starting this chain of changes. Just what this project needed :-) There's probably going to be some issues after this that has to bee fixed after such huge changes. Some issues that I have not had time to fix yet tho: #101 #102 and I'm going on a two week computer-free holiday starting tomorrow but I may be able to communicate from my phone. I hope that I can hand over business to @meldanya for a while, if you have time buddy :) |
Excellent! Thanks for your hard work @erikw and @jfelchner! |
Good job! Much more pleasant to work with the code now :) I will try to steer the ship in your absence @erikw, but I can't guarantee that it won't hit an iceberg while I'm at the controls :) I do however have finals coming up this week so I won't be able to do much until this Friday. |
This pull request cleans up the code quite a bit.
lib
andconfig
directoriesstatus-left.sh
andstatus-right.sh
. Instead there is onepowerbar.sh
file which, when called with the proper side (egpowerbar.sh left
) just does the right thing$OSTYPE
environment variable and functions provided to use in conditionals (egshell_is_osx
shell_is_linux
)ALL_CAPS
and start withTMUX_POWERBAR
__
(this was already the case but I continued with it)lib.sh
especially was becoming a junk drawer with methods for everything from formatting to Tmux to muting the barThere's still some work I want to do here but I wanted to start getting feedback from everyone. Specifically:
__<segment_name>_run
which returns the text to display in the segment. This will eliminate all of the subshelling that's currently happening to execute all of the scripts and should give a noticeable speed improvement.A few other things.
Comments are welcome.
Thanks!