nabn / web-indent

Automatically exported from code.google.com/p/web-indent
0 stars 0 forks source link

insert mode, SearchForPair given the wrong result #14

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
        'removeFileTip': function( ) {
            if() {
            //insert mode, type }
        }, 

What is the expected output? What do you see instead?
        'removeFileTip': function( ) {
            if() {
            }
        }, 

What version of the product are you using? On what operating system?
r15, and
set indentkeys=0{,0},o,O,e,!<Tab>,*<Return> 

Please provide any additional information below.
s:SearchForPair

    " Set the cursor position to the beginning of the line (default
    " behavior when using ==)
    call cursor(a:lnum, 0)
should be 
    call cursor(a:lnum, 1)

Original issue reported on code.google.com by ouyangde...@gmail.com on 18 Jan 2012 at 9:54

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
The problem is that a cursor column of zero is invalid, so the call to cursor() 
doesn't work. This patch fixes it:

Index: javascript.vim
===================================================================
--- javascript.vim      (revision 4614)
+++ javascript.vim      (revision 4615)
@@ -86,7 +86,7 @@

        " Set the cursor position to the beginning of the line (default
        " behavior when using ==)
-       call cursor(a:lnum, 0)
+       call cursor(a:lnum, 1)

        " Search for the opening tag
        let mnum = searchpair(a:beg, '', a:end, 'bW', 

Original comment by agrif...@gmail.com on 31 Jan 2012 at 11:53

GoogleCodeExporter commented 8 years ago
Ah.  Good call.  I will make the update in the next release.  

Original comment by pkopr...@gmail.com on 9 Feb 2012 at 3:28