Improved vimgolf cli after failed attempt #79

Merged
merged 3 commits into from Feb 27, 2012

Projects

None yet

2 participants

@fgalassi

The diff as it is doesnt work well with "blank" differences. If, for example, you miss a space at the end of a line you can't see it. I tried wdiff and vimdiff (that show it well) in the environment var, but since vimgolf is getting diff output and printing it, while all these coloring differs expect a terminal, they don't work.

In the end i implemented vimdiff as the main difference tool by making the diff optional (since it's not just text, it starts vim) and while i was there, i added the ability to retry a challenge without re-downloading the challenge.

I think it all improves vimgolf user friendlyness.

Thank you

@igrigorik igrigorik commented on the diff Feb 27, 2012
lib/vimgolf/ui.rb
@@ -1,7 +1,14 @@
+require 'highline'
@igrigorik
igrigorik Feb 27, 2012 owner

Bit worried about this one.. What's the latest status of highline for windows/linux/mac? Also, mri/jruby/etc?

@fgalassi
fgalassi Feb 27, 2012

I am not sure what you are afraid of. highline was already there in the ask method, used by vimgolf setup so ran once at least by every golfer. Anyway, i don't know highline status, i can only report that it's used in my favourite tool for building command line ruby tools, that is visionmedia/commander, and that commander right now is all green on travis-ci. Looks good to me.
http://travis-ci.org/#!/ggilder/commander

@igrigorik
igrigorik Feb 27, 2012 owner

Doh, you're right! Nevermind me :-)

@igrigorik
Owner

Just did a quick test run - looks great, love the diff and retry functionality! Kudos.

QQ: this is unrelated to your patch, but are you running into any errors with servername flag to vim? Might have to back out that commit..

@igrigorik igrigorik merged commit 5659e46 into igrigorik:master Feb 27, 2012
@fgalassi

no, servername works ok here on vim 7.2/ubuntu with +clientserver. If it's related to vim being or not compiled with +clientserver you could get output of vim --version to check if support is there and act accordingly

@fgalassi

and if it is , as i understand it, something to avoid people cheating, i think you can easily leave it out. With people being able to tweak files in .vimgolf/put the only reasonable security would be re-runnning the log on the input text upon submission. Everything else is placebo.

@igrigorik
Owner

Yeah, I'm inclined to skip this check.. There are much easier way to cheat if you really want to. :-) Vimgolf is very much about community moderation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment