Skip to content

Commit

Permalink
installer: add editor.rogue configuration if EDITOR=vim selected
Browse files Browse the repository at this point in the history
Proactively activate the rogue.editor configuration option if the
user persists on using VIM even after being warned against it, to
avoid the possibility of terminal output corruption like the one
described in microsoft/terminal#9359.

Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
  • Loading branch information
carenas committed Nov 25, 2021
1 parent 7977f90 commit ab71321
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion installer/install.iss
Original file line number Diff line number Diff line change
Expand Up @@ -1866,7 +1866,7 @@ begin
// 2nd choice
Top:=TopOfLabels;
CbbEditor.Items.Add('Use Vim (the ubiquitous text editor) as Git'+#39+'s default editor');
CreateItemDescription(EditorPage,'The <A HREF=http://www.vim.org/>Vim editor</A>, while powerful, <A HREF=https://stackoverflow.blog/2017/05/23/stack-overflow-helping-one-million-developers-exit-vim/>can be hard to use</A>. Its user interface is'+#13+'unintuitive and its key bindings are awkward.'+#13+#13+'<RED>Note:</RED> Vim is the default editor of Git for Windows only for historical reasons, and'+#13+'it is highly recommended to switch to a modern GUI editor instead.'+#13+#13+'<RED>Note:</RED> This will leave the '+#39+'core.editor'+#39+' option unset, which will make Git fall back'+#13+'to the '+#39+'EDITOR'+#39+' environment variable. The default editor is Vim - but you'+#13+'may set it to some other editor of your choice.',Top,Left,LblEditor[GE_VIM],False);
CreateItemDescription(EditorPage,'The <A HREF=http://www.vim.org/>Vim editor</A>, while powerful, <A HREF=https://stackoverflow.blog/2017/05/23/stack-overflow-helping-one-million-developers-exit-vim/>can be hard to use</A>. Its user interface is'+#13+'unintuitive and its key bindings are awkward.'+#13+#13+'<RED>Note:</RED> Vim is the default editor of Git for Windows only for historical reasons, and'+#13+'it is highly recommended to switch to a modern GUI editor instead.'+#13+#13+'<RED>Note:</RED> This will leave the '+#39+'core.editor'+#39+' option unset and enable editor.rogue, which will make Git fall back'+#13+'to the '+#39+'EDITOR'+#39+' environment variable. The default editor is Vim - but you'+#13+'may set it to some other editor of your choice.',Top,Left,LblEditor[GE_VIM],False);
EditorAvailable[GE_VIM]:=True;
// 3rd choice
Expand Down Expand Up @@ -3365,6 +3365,8 @@ begin
WizardForm.StatusLabel.Caption:='Configuring default editor';
if (CbbEditor.ItemIndex=GE_Nano) then
GitSystemConfigSet('core.editor','nano.exe')
else if (CbbEditor.ItemIndex=GE_VIM) then
GitSystemConfigSet('editor.rogue', 'true')
else if ((CbbEditor.ItemIndex=GE_NotepadPlusPlus)) and (NotepadPlusPlusPath<>'') then
GitSystemConfigSet('core.editor','"'+NotepadPlusPlusPath+'" -multiInst -notabbar -nosession -noPlugin')
else if ((CbbEditor.ItemIndex=GE_VisualStudioCode)) and (VisualStudioCodePath<>'') then begin
Expand Down

0 comments on commit ab71321

Please sign in to comment.