From 842010ee5e29adc1a85ed4ab41a6bc05670f7bce Mon Sep 17 00:00:00 2001 From: kazukazuinaina Date: Sat, 1 Oct 2022 22:37:19 +0900 Subject: [PATCH] [delete] Redundant if nesting --- plugin/webdevicons.vim | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/plugin/webdevicons.vim b/plugin/webdevicons.vim index 596ec68..381bfa3 100644 --- a/plugin/webdevicons.vim +++ b/plugin/webdevicons.vim @@ -524,18 +524,17 @@ function! WebDevIconsGetFileTypeSymbol(...) abort for [pattern, glyph] in items(g:WebDevIconsUnicodeDecorateFileNodesPatternSymbols) if match(fileNode, pattern) != -1 let symbol = glyph + return glyph . s:DevIconsGetArtifactFix() break endif endfor - if symbol == g:WebDevIconsUnicodeDecorateFileNodesDefaultSymbol - if has_key(g:WebDevIconsUnicodeDecorateFileNodesExactSymbols, fileNode) - let symbol = g:WebDevIconsUnicodeDecorateFileNodesExactSymbols[fileNode] - elseif ((isDirectory == 1 && g:DevIconsEnableFolderExtensionPatternMatching) || isDirectory == 0) && has_key(g:WebDevIconsUnicodeDecorateFileNodesExtensionSymbols, fileNodeExtension) - let symbol = g:WebDevIconsUnicodeDecorateFileNodesExtensionSymbols[fileNodeExtension] - elseif isDirectory == 1 - let symbol = g:WebDevIconsUnicodeDecorateFolderNodesDefaultSymbol - endif + if has_key(g:WebDevIconsUnicodeDecorateFileNodesExactSymbols, fileNode) + let symbol = g:WebDevIconsUnicodeDecorateFileNodesExactSymbols[fileNode] + elseif ((isDirectory == 1 && g:DevIconsEnableFolderExtensionPatternMatching) || isDirectory == 0) && has_key(g:WebDevIconsUnicodeDecorateFileNodesExtensionSymbols, fileNodeExtension) + let symbol = g:WebDevIconsUnicodeDecorateFileNodesExtensionSymbols[fileNodeExtension] + elseif isDirectory == 1 + let symbol = g:WebDevIconsUnicodeDecorateFolderNodesDefaultSymbol endif else