Patch 8.2.1214
Problem:    MS-Windows: default _vimrc not correct in silent install mode.
Solution:   Add the LoadDefaultVimrc macro. (Ken Takata, closes #6451)
Files:      nsis/gvim.nsi


*** ../vim-8.2.1213/nsis/gvim.nsi       2020-02-12 21:03:28.902269345 +0100
--- nsis/gvim.nsi       2020-07-14 22:22:42.915386864 +0200
***************
*** 687,692 ****
--- 687,701 ----
        ${EndIf}
  !macroend
  
+ !macro LoadDefaultVimrc out_var reg_value default_value
+       ClearErrors
+       ReadRegStr ${out_var} HKLM "${UNINST_REG_KEY_VIM}" ${reg_value}
+       ${If} ${Errors}
+       ${OrIf} ${out_var} == ""
+         StrCpy ${out_var} ${default_value}
+       ${EndIf}
+ !macroend
+ 
  Function .onInit
  !ifdef HAVE_MULTI_LANG
    # Select a language (or read from the registry).
***************
*** 718,727 ****
  !endif
    ${EndIf}
  
- # Load the selections from the registry (if any).
    ${If} ${RunningX64}
      SetRegView 64
    ${EndIf}
    !insertmacro LoadSectionSelection ${id_section_console}    "select_console"
    !insertmacro LoadSectionSelection ${id_section_batch}      "select_batch"
    !insertmacro LoadSectionSelection ${id_section_desktop}    "select_desktop"
--- 727,736 ----
  !endif
    ${EndIf}
  
    ${If} ${RunningX64}
      SetRegView 64
    ${EndIf}
+   # Load the selections from the registry (if any).
    !insertmacro LoadSectionSelection ${id_section_console}    "select_console"
    !insertmacro LoadSectionSelection ${id_section_batch}      "select_batch"
    !insertmacro LoadSectionSelection ${id_section_desktop}    "select_desktop"
***************
*** 736,741 ****
--- 745,754 ----
  !ifdef HAVE_NLS
    !insertmacro LoadSectionSelection ${id_section_nls}        "select_nls"
  !endif
+   # Load the default _vimrc settings from the registry (if any).
+   !insertmacro LoadDefaultVimrc $vim_compat_stat "vim_compat" "all"
+   !insertmacro LoadDefaultVimrc $vim_keymap_stat "vim_keyremap" "default"
+   !insertmacro LoadDefaultVimrc $vim_mouse_stat "vim_mouse" "default"
    ${If} ${RunningX64}
      SetRegView lastused
    ${EndIf}
***************
*** 799,815 ****
        ${NSD_CB_AddString} $vim_nsd_compat $(str_msg_compat_defaults)
        ${NSD_CB_AddString} $vim_nsd_compat $(str_msg_compat_all)
  
!       # Default selection
!       ${If} $vim_compat_stat == ""
!         ReadRegStr $3 HKLM "${UNINST_REG_KEY_VIM}" "vim_compat"
!       ${Else}
!         StrCpy $3 $vim_compat_stat
!       ${EndIf}
!       ${If} $3 == "defaults"
          StrCpy $4 2
!       ${ElseIf} $3 == "vim"
          StrCpy $4 1
!       ${ElseIf} $3 == "vi"
          StrCpy $4 0
        ${Else} # default
          StrCpy $4 3
--- 812,822 ----
        ${NSD_CB_AddString} $vim_nsd_compat $(str_msg_compat_defaults)
        ${NSD_CB_AddString} $vim_nsd_compat $(str_msg_compat_all)
  
!       ${If} $vim_compat_stat == "defaults"
          StrCpy $4 2
!       ${ElseIf} $vim_compat_stat == "vim"
          StrCpy $4 1
!       ${ElseIf} $vim_compat_stat == "vi"
          StrCpy $4 0
        ${Else} # default
          StrCpy $4 3
***************
*** 828,840 ****
        ${NSD_CB_AddString} $vim_nsd_keymap $(str_msg_keymap_default)
        ${NSD_CB_AddString} $vim_nsd_keymap $(str_msg_keymap_windows)
  
!       # Default selection
!       ${If} $vim_keymap_stat == ""
!         ReadRegStr $3 HKLM "${UNINST_REG_KEY_VIM}" "vim_keyremap"
!       ${Else}
!         StrCpy $3 $vim_keymap_stat
!       ${EndIf}
!       ${If} $3 == "windows"
          StrCpy $4 1
        ${Else} # default
          StrCpy $4 0
--- 835,841 ----
        ${NSD_CB_AddString} $vim_nsd_keymap $(str_msg_keymap_default)
        ${NSD_CB_AddString} $vim_nsd_keymap $(str_msg_keymap_windows)
  
!       ${If} $vim_keymap_stat == "windows"
          StrCpy $4 1
        ${Else} # default
          StrCpy $4 0
***************
*** 854,868 ****
        ${NSD_CB_AddString} $vim_nsd_mouse $(str_msg_mouse_windows)
        ${NSD_CB_AddString} $vim_nsd_mouse $(str_msg_mouse_unix)
  
!       # Default selection
!       ${If} $vim_mouse_stat == ""
!         ReadRegStr $3 HKLM "${UNINST_REG_KEY_VIM}" "vim_mouse"
!       ${Else}
!         StrCpy $3 $vim_mouse_stat
!       ${EndIf}
!       ${If} $3 == "xterm"
          StrCpy $4 2
!       ${ElseIf} $3 == "windows"
          StrCpy $4 1
        ${Else} # default
          StrCpy $4 0
--- 855,863 ----
        ${NSD_CB_AddString} $vim_nsd_mouse $(str_msg_mouse_windows)
        ${NSD_CB_AddString} $vim_nsd_mouse $(str_msg_mouse_unix)
  
!       ${If} $vim_mouse_stat == "xterm"
          StrCpy $4 2
!       ${ElseIf} $vim_mouse_stat == "windows"
          StrCpy $4 1
        ${Else} # default
          StrCpy $4 0
*** ../vim-8.2.1213/src/version.c       2020-07-14 22:11:01.217025006 +0200
--- src/version.c       2020-07-14 22:24:21.911147921 +0200
***************
*** 756,757 ****
--- 756,759 ----
  {   /* Add new patch number below this line */
+ /**/
+     1214,
  /**/

-- 
How To Keep A Healthy Level Of Insanity:
9. As often as possible, skip rather than walk.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
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 on the web visit 
https://groups.google.com/d/msgid/vim_dev/202007142025.06EKPKi93148488%40masaka.moolenaar.net.

Raspunde prin e-mail lui