Sign in to follow this  
Alberth

Smart tricks / hacks

Recommended Posts

The other day, I had an error from Lua that it missed an "end" at <EOF>, from a function that started 300 lines up.

My editor knows how to jump to matching parentheses, but it doesn't know how to jump to a matching 'start of statement' from and 'end', so how to solve this?

Then I realized the syntax highlighting colors "end" of a normal statement blue, and "end" of a function yellow, and I could use that to find the point of the missing "end".
So I inserted an "end" at a line at the top-level. If it got colored yellow, I'd be too high, if it got colored blue I'd be too low.
By using this trick I found the missing "end" statement in less than a minute. Edited by Alberth

Share this post


Link to post
Share on other sites

My editor knows how to jump to matching parentheses, but it doesn't know how to jump to a matching 'start of statement' from and 'end', so how to solve this?

Get a better editor?

Any competent editor should be able to figure out the beginning/end of a scope in languages with syntactically-significant whitespace these days. Edited by swiftcoder

Share this post


Link to post
Share on other sites

I thought it would be fun to exchange clever tricks, but if you want to change it into an editor or language war, be my guest, but I won't play.

 

Very true,  all is just for fun, exchange clever tricks or  talking about not so clever editors. All the same jokes mate, no wars, just jokes, absolutely nothing personal

Share this post


Link to post
Share on other sites

I thought it would be fun to exchange clever tricks, but if you want to change it into an editor or language war, be my guest, but I won't play.

 

You posted it in the "coding horror" humor section, so I genuinely thought by "clever tricks" you jokingly meant bad tricks or tricks to work around bad tools.

 

That's why other posters mentioned turning it into a joking thread of mistakes their favorite editors make - not an editor war trying to claim which is best.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this