nsis: Fix indentation and alignment issues in gvim.nsi

Commit: 
https://github.com/vim/vim/commit/f9feda2d6db66bd26a44f52424b430f4cb1ed50f
Author: RestorerZ <[email protected]>
Date:   Mon Sep 29 19:46:23 2025 +0000

    nsis: Fix indentation and alignment issues in gvim.nsi
    
    related: https://github.com/vim/vim/issues/18440
    
    Signed-off-by: RestorerZ <[email protected]>
    Signed-off-by: Christian Brabandt <[email protected]>

diff --git a/nsis/gvim.nsi b/nsis/gvim.nsi
index 04040b4d2..4b47536a0 100644
--- a/nsis/gvim.nsi
+++ b/nsis/gvim.nsi
@@ -1,6 +1,7 @@
 # NSIS file to create a self-installing exe for Vim.
 # It requires NSIS version 3.0 or later.
-# Last Change: 2025 Feb 24
+# Last Change: 2025-08-30
+#
 
 Unicode true
 
@@ -93,35 +94,35 @@ ${StrRep}
 ;FileExists is already part of LogicLib, but returns true for directories
 ;as well as files
 !macro _FileExists2 _a _b _t _f
-       !insertmacro _LOGICLIB_TEMP
-       StrCpy $_LOGICLIB_TEMP "0"
+  !insertmacro _LOGICLIB_TEMP
+  StrCpy $_LOGICLIB_TEMP "0"
 ;if path is not blank, continue to next check
-       StrCmp `${_b}` `` +4 0
+  StrCmp `${_b}` `` +4 0
 ;if path exists, continue to next check (IfFileExists returns true if this
 ;is a directory)
-       IfFileExists `${_b}` `0` +3
+  IfFileExists `${_b}` `0` +3
 ;if path is not a directory, continue to confirm exists
-       IfFileExists `${_b}\*.*` +2 0
-       StrCpy $_LOGICLIB_TEMP "1" ;file exists
+  IfFileExists `${_b}\*.*` +2 0
+StrCpy $_LOGICLIB_TEMP "1" ;file exists
 ;now we have a definitive value - the file exists or it does not
-       StrCmp $_LOGICLIB_TEMP "1" `${_t}` `${_f}`
+  StrCmp $_LOGICLIB_TEMP "1" `${_t}` `${_f}`
 !macroend
 !undef FileExists
 !define FileExists `"" FileExists2`
 !macro _DirExists _a _b _t _f
-       !insertmacro _LOGICLIB_TEMP
-       StrCpy $_LOGICLIB_TEMP "0"
+  !insertmacro _LOGICLIB_TEMP
+  StrCpy $_LOGICLIB_TEMP "0"
 ;if path is not blank, continue to next check
-       StrCmp `${_b}` `` +3 0
+  StrCmp `${_b}` `` +3 0
 ;if directory exists, continue to confirm exists
-       IfFileExists `${_b}\*.*` 0 +2
-       StrCpy $_LOGICLIB_TEMP "1"
-       StrCmp $_LOGICLIB_TEMP "1" `${_t}` `${_f}`
+  IfFileExists `${_b}\*.*` 0 +2
+  StrCpy $_LOGICLIB_TEMP "1"
+  StrCmp $_LOGICLIB_TEMP "1" `${_t}` `${_f}`
 !macroend
 !define DirExists `"" DirExists`
 
 !define PRODUCT                "Vim ${VER_MAJOR}.${VER_MINOR}"
-!define UNINST_REG_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall"
+!define UNINST_REG_KEY  "Software\Microsoft\Windows\CurrentVersion\Uninstall"
 !define UNINST_REG_KEY_VIM  "${UNINST_REG_KEY}\${PRODUCT}"
 
 !if ${WIN64}
@@ -146,9 +147,9 @@ RequestExecutionLevel highest
 !endif
 
 !if ${WIN64}
-!define BIT    64
+  !define BIT 64
 !else
-!define BIT    32
+  !define BIT 32
 !endif
 
 ##########################################################
@@ -164,26 +165,26 @@ RequestExecutionLevel highest
 !define MUI_LANGDLL_ALLLANGUAGES
 # Always show dialog choice language
 #!define MUI_LANGDLL_ALWAYSSHOW
-!define MUI_LANGDLL_REGISTRY_ROOT       "HKCU"
-!define MUI_LANGDLL_REGISTRY_KEY        "Software\Vim"
+!define MUI_LANGDLL_REGISTRY_ROOT      "HKCU"
+!define MUI_LANGDLL_REGISTRY_KEY       "Software\Vim"
 !define MUI_LANGDLL_REGISTRY_VALUENAME  "Installer Language"
 
-!define MUI_WELCOMEFINISHPAGE_BITMAP       "icons\welcome.bmp"
-!define MUI_UNWELCOMEFINISHPAGE_BITMAP     "icons\uninstall.bmp"
+!define MUI_WELCOMEFINISHPAGE_BITMAP   "icons\welcome.bmp"
+!define MUI_UNWELCOMEFINISHPAGE_BITMAP "icons\uninstall.bmp"
 !define MUI_HEADERIMAGE
-!define MUI_HEADERIMAGE_BITMAP             "icons\header.bmp"
-!define MUI_HEADERIMAGE_UNBITMAP           "icons\un_header.bmp"
+!define MUI_HEADERIMAGE_BITMAP         "icons\header.bmp"
+!define MUI_HEADERIMAGE_UNBITMAP       "icons\un_header.bmp"
 
-!define MUI_WELCOMEFINISHPAGE_BITMAP_STRETCH    "AspectFitHeight"
+!define MUI_WELCOMEFINISHPAGE_BITMAP_STRETCH   "AspectFitHeight"
 !define MUI_UNWELCOMEFINISHPAGE_BITMAP_STRETCH  "AspectFitHeight"
-!define MUI_HEADERIMAGE_BITMAP_STRETCH          "AspectFitHeight"
-!define MUI_HEADERIMAGE_UNBITMAP_STRETCH        "AspectFitHeight"
+!define MUI_HEADERIMAGE_BITMAP_STRETCH         "AspectFitHeight"
+!define MUI_HEADERIMAGE_UNBITMAP_STRETCH       "AspectFitHeight"
 
 !define MUI_COMPONENTSPAGE_SMALLDESC
 !define MUI_LICENSEPAGE_CHECKBOX
 !define MUI_FINISHPAGE_SHOWREADME
-!define MUI_FINISHPAGE_SHOWREADME_TEXT     $(str_show_readme)
-!define MUI_FINISHPAGE_SHOWREADME_FUNCTION  LaunchApplication
+!define MUI_FINISHPAGE_SHOWREADME_TEXT         $(str_show_readme)
+!define MUI_FINISHPAGE_SHOWREADME_FUNCTION     LaunchApplication
 
 # This adds '\Vim' to the user choice automagically.  The actual value is
 # obtained below with CheckOldVim.
@@ -232,18 +233,18 @@ Page custom SetCustom ValidateCustom
 
 # Include support for other languages:
 !if ${HAVE_MULTI_LANG}
-    !include "lang\portuguesebr.nsi"
-    !include "lang\danish.nsi"
-    !include "lang\dutch.nsi"
-    !include "lang\german.nsi"
-    !include "lang\greek.nsi"
-    !include "lang\italian.nsi"
-    !include "lang\japanese.nsi"
-    !include "lang
ussian.nsi"
-    !include "lang\serbian.nsi"
-    !include "lang\simpchinese.nsi"
-    !include "lang     radchinese.nsi"
-    !include "lang     urkish.nsi"
+  !include "lang\portuguesebr.nsi"
+  !include "lang\danish.nsi"
+  !include "lang\dutch.nsi"
+  !include "lang\german.nsi"
+  !include "lang\greek.nsi"
+  !include "lang\italian.nsi"
+  !include "lang\japanese.nsi"
+  !include "lang
ussian.nsi"
+  !include "lang\serbian.nsi"
+  !include "lang\simpchinese.nsi"
+  !include "lang       radchinese.nsi"
+  !include "lang       urkish.nsi"
 !endif
 
 ##########################################################
@@ -253,8 +254,10 @@ VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "Vim"
 VIAddVersionKey /LANG=${LANG_ENGLISH} "CompanyName" "The Vim Project"
 VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalTrademarks" "Vim"
 VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "Copyright (C) 1996"
-VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" "Vi Improved - A Text 
Editor"
-VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" 
"${VER_MAJOR}.${VER_MINOR}.${PATCHLEVEL}.0"
+VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" \
+    "Vi Improved - A Text Editor"
+VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" \
+    "${VER_MAJOR}.${VER_MINOR}.${PATCHLEVEL}.0"
 VIProductVersion "${VER_MAJOR}.${VER_MINOR}.${PATCHLEVEL}.0"
 
 # Global variables
@@ -266,10 +269,9 @@ Var vim_compat_stat
 Var vim_keymap_stat
 Var vim_mouse_stat
 !if ${HAVE_NLS}
-Var lng_usr
+  Var lng_usr
 !endif
 
-
 # Reserve files
 ReserveFile ${VIMSRC}\installw32.exe
 
@@ -337,9 +339,9 @@ Function CheckOldVim
   ${EndIf}
 
   ClearErrors
-  StrCpy $0  ""   # Installed directory
-  StrCpy $R0 0    # Sub-key index
-  StrCpy $R1 ""   # Sub-key
+  StrCpy $0 "" # Installed directory
+  StrCpy $R0 0 # Sub-key index
+  StrCpy $R1 ""        # Sub-key
   ${Do}
     # Eumerate the sub-key:
     EnumRegKey $R1 HKLM ${UNINST_REG_KEY} $R0
@@ -376,7 +378,7 @@ Function CheckOldVim
     Push $R2
     call GetParent
     call GetParent
-    Pop $0   # Vim directory
+    Pop $0  # Vim directory
     ${ExitDo}
 
   ${Loop}
@@ -392,447 +394,443 @@ Function CheckOldVim
 FunctionEnd
 
 Function LaunchApplication
-   SetOutPath $0
-   ShellExecAsUser::ShellExecAsUser "" "$0\gvim.exe" '-R 
"$0\$(vim_readme_file)"'
+  SetOutPath $0
+  ShellExecAsUser::ShellExecAsUser "" "$0\gvim.exe" '-R 
"$0\$(vim_readme_file)"'
 FunctionEnd
 
 ##########################################################
 Section "$(str_section_old_ver)" id_section_old_ver
-       SectionIn 1 2 3 RO
-
-       # run the install program to check for already installed versions
-       SetOutPath $TEMP
-       File /oname=install.exe ${VIMSRC}\installw32.exe
-       DetailPrint "$(str_msg_uninstalling)"
-       ${Do}
-         nsExec::Exec "$TEMP\install.exe -uninstall-check"
-         Pop $3
-
-         call CheckOldVim
-         Pop $3
-         ${If} $3 == ""
-           ${ExitDo}
-         ${Else}
-           # It seems that the old version is still remaining.
-           # TODO: Should we show a warning and run the uninstaller again?
-
-           ${ExitDo}   # Just ignore for now.
-         ${EndIf}
-       ${Loop}
-       Delete $TEMP\install.exe
-       Delete $TEMP imini.ini   # install.exe creates this, but we don't need 
it.
-
-       # We may have been put to the background when uninstall did something.
-       BringToFront
+  SectionIn 1 2 3 RO
+
+  # run the install program to check for already installed versions
+  SetOutPath $TEMP
+  File /oname=install.exe ${VIMSRC}\installw32.exe
+  DetailPrint "$(str_msg_uninstalling)"
+  ${Do}
+    nsExec::Exec "$TEMP\install.exe -uninstall-check"
+    Pop $3
+
+    call CheckOldVim
+    Pop $3
+    ${If} $3 == ""
+      ${ExitDo}
+    ${Else}
+      # It seems that the old version is still remaining.
+      # TODO: Should we show a warning and run the uninstaller again?
+
+      ${ExitDo}        # Just ignore for now.
+    ${EndIf}
+  ${Loop}
+  Delete $TEMP\install.exe
+  Delete $TEMP imini.ini   # install.exe creates this, but we don't need it.
+
+  # We may have been put to the background when uninstall did something.
+  BringToFront
 SectionEnd
 
 ##########################################################
 Section "$(str_section_exe)" id_section_exe
-       SectionIn 1 2 3 RO
+  SectionIn 1 2 3 RO
 
-       # we need also this here if the user changes the instdir
-       StrCpy $0 "$INSTDIR im${VER_MAJOR}${VER_MINOR}"
+  # we need also this here if the user changes the instdir
+  StrCpy $0 "$INSTDIR im${VER_MAJOR}${VER_MINOR}"
 
-       SetOutPath $0
-       File /oname=gvim.exe ${VIMSRC}\gvim_ole.exe
-!if /FileExists "${VIMSRC} im${BIT}.dll"
-       File ${VIMSRC} im${BIT}.dll
-!endif
-       File /oname=install.exe ${VIMSRC}\installw32.exe
-       File /oname=uninstall.exe ${VIMSRC}\uninstallw32.exe
-       File ${VIMSRC} imrun.exe
-       File /oname=tee.exe ${VIMSRC}   eew32.exe
-       File /oname=xxd.exe ${VIMSRC}\xxdw32.exe
-       File .. imtutor.bat
-       File ..\README.txt
-       File /oname=LICENSE.txt ..\LICENSE
-       File ..\uninstall.txt
-       File ${VIMRT}\*.vim
-
-!if /FileExists "${VIMTOOLS}\diff.exe"
-       File ${VIMTOOLS}\diff.exe
-!endif
-!if /FileExists "${VIMTOOLS}\winpty${BIT}.dll"
-       File ${VIMTOOLS}\winpty${BIT}.dll
-!endif
-!if /FileExists "${VIMTOOLS}\winpty-agent.exe"
-       File ${VIMTOOLS}\winpty-agent.exe
-!endif
-!if /FileExists "${VIMTOOLS}\libsodium.dll"
-       File ${VIMTOOLS}\libsodium.dll
-!endif
+  SetOutPath $0
+  File /oname=gvim.exe ${VIMSRC}\gvim_ole.exe
+  !if /FileExists "${VIMSRC} im${BIT}.dll"
+    File ${VIMSRC} im${BIT}.dll
+  !endif
+  File /oname=install.exe ${VIMSRC}\installw32.exe
+  File /oname=uninstall.exe ${VIMSRC}\uninstallw32.exe
+  File ${VIMSRC} imrun.exe
+  File /oname=tee.exe ${VIMSRC}        eew32.exe
+  File /oname=xxd.exe ${VIMSRC}\xxdw32.exe
+  File .. imtutor.bat
+  File ..\README.txt
+  File /oname=LICENSE.txt ..\LICENSE
+  File ..\uninstall.txt
+  File ${VIMRT}\*.vim
+
+  !if /FileExists "${VIMTOOLS}\diff.exe"
+    File ${VIMTOOLS}\diff.exe
+  !endif
+  !if /FileExists "${VIMTOOLS}\winpty${BIT}.dll"
+    File ${VIMTOOLS}\winpty${BIT}.dll
+  !endif
+  !if /FileExists "${VIMTOOLS}\winpty-agent.exe"
+    File ${VIMTOOLS}\winpty-agent.exe
+  !endif
+  !if /FileExists "${VIMTOOLS}\libsodium.dll"
+    File ${VIMTOOLS}\libsodium.dll
+  !endif
 
-       SetOutPath $0

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/vim_dev/E1v3K2V-001nDE-Le%40256bit.org.

Raspunde prin e-mail lui