]> git.nbdom.net Git - nb.git/commitdiff
etc/vim/source/map.vim
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Mon, 9 Jun 2025 07:30:30 +0000 (08:30 +0100)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Mon, 9 Jun 2025 07:30:30 +0000 (08:30 +0100)
etc/vim/source/map.vim

index 85b3e3f500d3bc215e33634ec7c374a47493a7e2..bb1245deda9501e515a7ccae90dfcf08a5bdf384 100644 (file)
@@ -52,6 +52,7 @@ func! CommentSubSpecialChar(text)
        let val = ''
        for val in a:text
          let a:text[i] = substitute(val,'\\n',"\n",'')
+         "let a:text[i] = substitute(a:text[i],'\n',"\r",'')
                let i += 1
        endfor
 endfunc
@@ -90,7 +91,9 @@ func! CommentToggle()
        endif
 
        let comment = split(comment,'\s\+')
-       " call CommentSubSpecialChar(comment)
+       " NB 09.06.25: For css  
+       " let comment = substitute(comment,'\n','\r','g')
+       "call CommentSubSpecialChar(comment)
 
        let curr_line = getline('.')
        "
@@ -102,6 +105,7 @@ func! CommentToggle()
        if ( len(comment)>1 )
          let new_line = substitute(new_line,'\s*'.comment[1].'\s*$','','')
        endif
+        "let new_line = substitute(new_line,'\r','\n','g')
 
        if new_line == curr_line
          "
@@ -115,7 +119,7 @@ func! CommentToggle()
          if ( len(comment)>1 )
            let new_line = substitute(new_line,'\s*$',' '.comment[1],'')
          endif
-         " let new_line = substitute(new_line,'\\n',"\n",'')
+         "let new_line = substitute(new_line,'\n',"\n",'g')
        endif
 
        call setline('.',new_line)