Wednesday, January 28, 2015

Re: Double quotes throws off SQL syntax colouring

On Wednesday, January 28, 2015 at 9:28:15 AM UTC-6, Paul wrote:
> I'm editing a file tmp.sql with syntax colouring. The following code
> all turns yellow after the first double quote (actual file contains a
> lot more code). I'm in an environment, where upgrading anything is
> difficult. Is there anything superficial changes I can make to
> prevent this unexpected colour behaviour?
>
> SELECT
> Field1,
> COUNT(*) AS Field2,
> MIN ( LEN( REPLACE( EEEPppp, "\", "" ) ) ) AS Field3,
> FROM someTable
> etc....
>

Why is that unexpected?

I'm not familiar with SQL syntax, but some brief searching shows that at least sometimes, '\' can escape a '"' character as it can in many other languages (although I also see that sometimes it cannot escape the quote...so maybe this is one of those times, please correct me if that's the case).

So, if I'm reading that right, you're using a single string containing a literal " character, a comma, and a space. Then you're opening the next string. It looks like maybe you wanted to use '\', '' or "\\", "" or something like that instead of "\", "" in your code.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment