[PATCH] D107289: [vim] Fix regexp matching against syntax attribute

Alf via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 2 09:47:55 PDT 2021


gAlfonso-bit created this revision.
gAlfonso-bit added a reviewer: LLVM.
gAlfonso-bit requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

There is no operator =? in Vim. Use =~? for regexp matching ignoring case.
Using double quote in rhs does not work with the pattern. Use single quote.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D107289

Files:
  llvm/utils/vim/indent/llvm.vim


Index: llvm/utils/vim/indent/llvm.vim
===================================================================
--- llvm/utils/vim/indent/llvm.vim
+++ llvm/utils/vim/indent/llvm.vim
@@ -52,7 +52,7 @@
 
   " Find a non-blank not-completely commented line above the current line.
   let prev_lnum = prevnonblank(v:lnum - 1)
-  while prev_lnum > 0 && synIDattr(synID(prev_lnum, indent(prev_lnum)+1, 0), "name") =? "string\|comment"
+  while prev_lnum > 0 && synIDattr(synID(prev_lnum, indent(prev_lnum)+1, 0), 'name') =~? 'string\|comment'
     let prev_lnum = prevnonblank(prev_lnum-1)
   endwhile
   " Hit the start of the file, use zero indent.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D107289.363503.patch
Type: text/x-patch
Size: 639 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210802/108c6a6c/attachment.bin>


More information about the llvm-commits mailing list