From fea637c3c298962f4a880fcd12ec848b9b771185 Mon Sep 17 00:00:00 2001 From: Sarunas Valaskevicius Date: Sun, 14 Jan 2024 15:13:07 +0000 Subject: [PATCH] Fix alternative delimiter usage in alternate buffers Copy the configuration for a file rather than capture by reference. Due to the logic in the alternative delimiter configurator, which swaps the delimiters when called, every second buffer the script is used swaps the delimiter order in the original config. This leads to incorrect delimiters being used in every second buffer. This change makes a copy for each buffer so swapping the order will not affect the next loaded buffer. --- autoload/nerdcommenter.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoload/nerdcommenter.vim b/autoload/nerdcommenter.vim index 1103342..9fec69b 100644 --- a/autoload/nerdcommenter.vim +++ b/autoload/nerdcommenter.vim @@ -484,7 +484,7 @@ function! nerdcommenter#SetUp() abort let b:NERDSexyComMarker = '' if has_key(s:delimiterMap, filetype) - let b:NERDCommenterDelims = s:delimiterMap[filetype] + let b:NERDCommenterDelims = copy(s:delimiterMap[filetype]) for i in ['left', 'leftAlt', 'right', 'rightAlt'] if !has_key(b:NERDCommenterDelims, i) let b:NERDCommenterDelims[i] = ''