1. Mats Rauhala
  2. slimv

Commits

Mats Rauhala  committed d327816

When editing with cw, keep the ending whitespace

  • Participants
  • Parent commits 59c11af
  • Branches default

Comments (0)

Files changed (1)

File plugin/paredit.vim

View file
  • Ignore whitespace
         let putreg = getreg( '"' )
 
         " Find and keep unbalanced matched characters in the region
+        let endingwhitespace = matchstr(putreg, "\\s*$")
         let matched = s:GetMatchedChars( putreg, s:InsideString( "'<" ), s:InsideComment( "'<" ) )
         let matched = s:Unbalanced( matched )
         let matched = substitute( matched, '\s', '', 'g' )
+        if a:func == 'c'
+            let matched = matched . endingwhitespace
+        endif
 
         if matched == ''
             silent exe "normal! gvx"
         else
             silent exe "normal! gvc" . matched
-            silent exe "normal! l"
+            if a:func != 'c'
+                silent exe "normal! l"
+            endif
         endif
     endif