mirror of
				https://github.com/jiangmiao/auto-pairs.git
				synced 2025-11-04 11:29:22 +08:00 
			
		
		
		
	Fix jump incorrect
This commit is contained in:
		@ -198,10 +198,10 @@ func! AutoPairsInsert(key)
 | 
				
			|||||||
        end
 | 
					        end
 | 
				
			||||||
      end
 | 
					      end
 | 
				
			||||||
      if open != close
 | 
					      if open != close
 | 
				
			||||||
        let m = s:matchend(after, '^\v\s*\zs\V'.close)
 | 
					        let m = matchstr(after, '^\v\s*\zs\V'.close)
 | 
				
			||||||
        if len(m) > 0
 | 
					        if m != ''
 | 
				
			||||||
          " skip close pair greedy
 | 
					          " skip close pair greedy
 | 
				
			||||||
          call search(m[1], 'We')
 | 
					          call search(m, 'We')
 | 
				
			||||||
          return "\<Right>"
 | 
					          return "\<Right>"
 | 
				
			||||||
        end
 | 
					        end
 | 
				
			||||||
      end
 | 
					      end
 | 
				
			||||||
@ -285,6 +285,15 @@ func! AutoPairsDelete()
 | 
				
			|||||||
      return repeat("\<BS>", s:ulen(b)).repeat("\<DELETE>", s:ulen(a))
 | 
					      return repeat("\<BS>", s:ulen(b)).repeat("\<DELETE>", s:ulen(a))
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
  endfor
 | 
					  endfor
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  return "\<BS>"
 | 
				
			||||||
 | 
					  " delete the pair foo[]| <BS> to foo
 | 
				
			||||||
 | 
					  for [open, close] in b:AutoPairsList
 | 
				
			||||||
 | 
					    let m = s:matchend(before, '\V'.open.'\v\s*'.'\V'.close.'\v$')
 | 
				
			||||||
 | 
					    if len(m) > 0
 | 
				
			||||||
 | 
					      return s:backspace(m[2])
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					  endfor
 | 
				
			||||||
  return "\<BS>"
 | 
					  return "\<BS>"
 | 
				
			||||||
endf
 | 
					endf
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user