Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unmatched "

Status
Not open for further replies.

mrn

MIS
Apr 27, 2001
3,993
GB
Anyone got a good method / script for finding unmatched " I know you can use % in vi to id matching ( { [



Mike

"Whenever I dwell for any length of time on my own shortcomings, they gradually begin to seem mild, harmless, rather engaging little things, not at all like the staring defects in other people's characters."
 
I look for "-character (/"), then with cursor positioned on a starting "-char, I hit n (next occurence) twice, which should bring me to the next starting "-char.

But it is a bit awkward. Gotta pay attention to where the cursor jumps to...


HTH,

p5wizard
 
Thanks,

Thats what I ended up doing; not fun on a couple thousand lines of code. Any other ideas welcome to help correct my future mistakes...

Mike

"Whenever I dwell for any length of time on my own shortcomings, they gradually begin to seem mild, harmless, rather engaging little things, not at all like the staring defects in other people's characters."
 
Mike,

The big problem for automating this would be clearly defining what it means to be a matching quote, since strings can contain character sequences that look the same as code.

One approach (maybe the best) would be to use an editor with syntax highlighting, such as vim or emacs. Forget to close a quote with proper syntax highlighting on and you'll see it right away.

- Rod


IBM Certified Advanced Technical Expert pSeries and AIX 5L
CompTIA Linux+
CompTIA Security+

Wish you could view posts with a fixed font? Got Firefox & Greasemonkey? Give yourself the option.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top