From f932eed94c720a071c26e0a74953059baa6ad4de Mon Sep 17 00:00:00 2001 From: clwu Date: Mon, 17 Oct 2016 08:19:49 +0800 Subject: [PATCH 1/3] fix comment no formated bug --- plugin/DoxygenToolkit.vim | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/plugin/DoxygenToolkit.vim b/plugin/DoxygenToolkit.vim index 37d51a6..1779dab 100644 --- a/plugin/DoxygenToolkit.vim +++ b/plugin/DoxygenToolkit.vim @@ -455,7 +455,7 @@ function! DoxygenLicenseFunc() if( g:DoxygenToolkit_licenseTag == s:licenseTag ) exec "normal %jA".l:date." - ".g:DoxygenToolkit_authorName endif - exec "normal `d" + exec "normal =%`d" call s:RestoreParameters() endfunction @@ -494,7 +494,7 @@ function! DoxygenAuthorFunc() endif " Move the cursor to the rigth position - exec "normal `d" + exec "normal =%`d" call s:RestoreParameters() startinsert! @@ -522,7 +522,7 @@ function! DoxygenUndocumentFunc(blockTag) endif endwhile - exec "normal `d" + exec "normal =%`d" call s:RestoreParameters() endfunction @@ -534,13 +534,16 @@ endfunction function! DoxygenBlockFunc() call s:InitializeParameters() + exec "set paste" let l:insertionMode = s:StartDocumentationBlock() exec "normal ".l:insertionMode.s:interCommentTag.g:DoxygenToolkit_blockTag mark d exec "normal o".s:interCommentTag."@{ ".s:endCommentTag + exec "normal =%2j" exec "normal o".strpart( s:startCommentTag, 0, 1 ) exec "normal A".strpart( s:startCommentTag, 1 )." @} ".s:endCommentTag - exec "normal `d" + exec "set nopaste" + exec "normal =%`d" call s:RestoreParameters() startinsert! @@ -816,7 +819,7 @@ function! DoxygenCommentFunc() exec "normal o".strpart( s:startCommentBlock, 0, 1 ) exec "normal A".strpart( s:startCommentBlock, 1 ).g:DoxygenToolkit_blockFooter.s:endCommentBlock endif - exec "normal `d" + exec "normal =%`d" call s:RestoreParameters() if( s:compactOneLineDoc =~ "yes" && s:endCommentTag != "" ) From 48028ae20c7275398459e88d9e8c5ad98ddab49b Mon Sep 17 00:00:00 2001 From: clwu Date: Mon, 17 Oct 2016 08:28:52 +0800 Subject: [PATCH 2/3] clear mark d --- plugin/DoxygenToolkit.vim | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugin/DoxygenToolkit.vim b/plugin/DoxygenToolkit.vim index 1779dab..646ee69 100644 --- a/plugin/DoxygenToolkit.vim +++ b/plugin/DoxygenToolkit.vim @@ -456,6 +456,7 @@ function! DoxygenLicenseFunc() exec "normal %jA".l:date." - ".g:DoxygenToolkit_authorName endif exec "normal =%`d" + mark d call s:RestoreParameters() endfunction @@ -495,6 +496,7 @@ function! DoxygenAuthorFunc() " Move the cursor to the rigth position exec "normal =%`d" + mark d call s:RestoreParameters() startinsert! @@ -523,6 +525,7 @@ function! DoxygenUndocumentFunc(blockTag) endwhile exec "normal =%`d" + mark d call s:RestoreParameters() endfunction @@ -544,6 +547,7 @@ function! DoxygenBlockFunc() exec "normal A".strpart( s:startCommentTag, 1 )." @} ".s:endCommentTag exec "set nopaste" exec "normal =%`d" + mark d call s:RestoreParameters() startinsert! @@ -820,6 +824,7 @@ function! DoxygenCommentFunc() exec "normal A".strpart( s:startCommentBlock, 1 ).g:DoxygenToolkit_blockFooter.s:endCommentBlock endif exec "normal =%`d" + mark d call s:RestoreParameters() if( s:compactOneLineDoc =~ "yes" && s:endCommentTag != "" ) From 62263191c56536bb19ea3bf3547bbc337f62246e Mon Sep 17 00:00:00 2001 From: clwu Date: Thu, 20 Oct 2016 11:10:13 +0800 Subject: [PATCH 3/3] delmarks d --- plugin/DoxygenToolkit.vim | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugin/DoxygenToolkit.vim b/plugin/DoxygenToolkit.vim index 646ee69..6db742b 100644 --- a/plugin/DoxygenToolkit.vim +++ b/plugin/DoxygenToolkit.vim @@ -456,7 +456,7 @@ function! DoxygenLicenseFunc() exec "normal %jA".l:date." - ".g:DoxygenToolkit_authorName endif exec "normal =%`d" - mark d + delmarks d call s:RestoreParameters() endfunction @@ -496,7 +496,7 @@ function! DoxygenAuthorFunc() " Move the cursor to the rigth position exec "normal =%`d" - mark d + delmarks d call s:RestoreParameters() startinsert! @@ -525,7 +525,7 @@ function! DoxygenUndocumentFunc(blockTag) endwhile exec "normal =%`d" - mark d + delmarks d call s:RestoreParameters() endfunction @@ -547,7 +547,7 @@ function! DoxygenBlockFunc() exec "normal A".strpart( s:startCommentTag, 1 )." @} ".s:endCommentTag exec "set nopaste" exec "normal =%`d" - mark d + delmarks d call s:RestoreParameters() startinsert! @@ -824,7 +824,7 @@ function! DoxygenCommentFunc() exec "normal A".strpart( s:startCommentBlock, 1 ).g:DoxygenToolkit_blockFooter.s:endCommentBlock endif exec "normal =%`d" - mark d + delmarks d call s:RestoreParameters() if( s:compactOneLineDoc =~ "yes" && s:endCommentTag != "" )