Matchit with PL/SQL

2007-03-21 Thread bobf32
Hello. 

I have just discovered the matchit plugin and have been using it to navigate
some Oracle PL/SQL scripts. My issue is as follows.

If I have a script containing:

create or replace procedure foo
as
begin
    null ;
end ;

then by placing the cursor on the word begin and hitting % the cursor jumps
to the word end. Great, that’s what I want. But if the script is

create or replace procedure foo
as
begin
    null ;
end foo ;

i.e. it names the procedure after the closing end, then the above navigation
doesn’t work. I’m loathe to change b:match_words as it looks a bit hairy,
but if someone has already addressed this, or can suggest a workaround, I’d
be grateful.

Thanks.




Re: Matchit with PL/SQL

2007-03-21 Thread David . Fishburn
(Had to top post)
I am the author of ftplugin/sql.vim which defines b:match_words.

It was set this way so that the following will not match.

begin
end if

I didn't realize plsql allowed your case.
I think this could be addressed by saying the end cannot be followed by the 
known end statements like:
End if
End case


Could you put together a conslusive list of plsql keywords that begin with end 
and I can update the script.

I will probably make it an option that can be set (with on as the default) in 
case this breaks other dbs syntax.

Dave



- Original Message -
From:  [EMAIL PROTECTED]
Sent: 03/21/2007 01:35 PM
To: vim@vim.org
Subject: Matchit with PL/SQL



Hello.

I have just discovered the matchit plugin and have been using it to navigate
some Oracle PL/SQL scripts. My issue is as follows.

If I have a script containing:

create or replace procedure foo
as
begin
    null ;
end ;

then by placing the cursor on the word begin and hitting % the cursor jumps
to the word end. Great, that’s what I want. But if the script is

create or replace procedure foo
as
begin
    null ;
end foo ;

i.e. it names the procedure after the closing end, then the above navigation
doesn’t work. I’m loathe to change b:match_words as it looks a bit hairy,
but if someone has already addressed this, or can suggest a workaround, I’d
be grateful.

Thanks.





RE: Matchit with PL/SQL

2007-03-21 Thread bobf32

end case
end if
end loop

Thanks. 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Wed 21 March 2007 20:36
To: bobf32; vim
Subject: Re: Matchit with PL/SQL

(Had to top post)
I am the author of ftplugin/sql.vim which defines b:match_words. 

It was set this way so that the following will not match. 

begin
end if

I didn't realize plsql allowed your case. 
I think this could be addressed by saying the end cannot be followed by the
known end statements like:
End if
End case


Could you put together a conslusive list of plsql keywords that begin with
end and I can update the script. 

I will probably make it an option that can be set (with on as the default)
in case this breaks other dbs syntax. 

Dave



- Original Message -
From:  [EMAIL PROTECTED]
Sent: 03/21/2007 01:35 PM
To: vim@vim.org
Subject: Matchit with PL/SQL



Hello. 

I have just discovered the matchit plugin and have been using it to navigate
some Oracle PL/SQL scripts. My issue is as follows.

If I have a script containing:

create or replace procedure foo
as
begin
    null ;
end ;

then by placing the cursor on the word begin and hitting % the cursor jumps
to the word end. Great, that’s what I want. But if the script is

create or replace procedure foo
as
begin
    null ;
end foo ;

i.e. it names the procedure after the closing end, then the above navigation
doesn’t work. I’m loathe to change b:match_words as it looks a bit hairy,
but if someone has already addressed this, or can suggest a workaround, I’d
be grateful.

Thanks.