view runtime/tutor/Make_mvc.mak @ 34536:ad6cd802579d v9.1.0170

patch 9.1.0170: Re-allow curwin == prevwin, but document it instead Commit: https://github.com/vim/vim/commit/d64801e913314d2e19dbb38f60e6d285238debff Author: Sean Dewar <6256228+seandewar@users.noreply.github.com> Date: Tue Mar 12 20:46:12 2024 +0100 patch 9.1.0170: Re-allow curwin == prevwin, but document it instead Problem: more places exist where curwin == prevwin, and it may even be expected in some cases. Solution: revert v9.1.0001, but document that it's possible instead. (Sean Dewar) I've had a change of heart for the following reasons: - A quick 'n dirty [GitHub code search](https://github.com/search?q=%2F%28winnr%5C%28%5C%29%5Cs*%3D%3D%5Cs*winnr%5C%28%5B%27%22%5D%23%5B%27%22%5D%5C%29%7Cwinnr%5C%28%5B%27%22%5D%23%5B%27%22%5D%5C%29%5Cs*%3D%3D%5Cs*winnr%5C%28%5C%29%29%2F&type=code) reveals some cases where it's expected in the wild. Particularly, it made me aware `winnr() == winnr('#')` is possible when curwin is changed temporarily during the evaluation of a &statusline expression item (`%{...}`), and is used to show something different on the statusline belonging to the previous window; that behaviour wasn't changed in v9.1.0001, but it means curwin == prevwin makes sense in some cases. - The definition and call sites of back_to_prevwin imply some expectation that prevwin == wp (== curwin) is possible, as it's used to skip entering the prevwin in that case. - Prior to v9.1.0001, `:wincmd p` would not beep in the case that was patched in v9.1.0001, but now does. That resulted in #14047 being opened, as it affected the CtrlP plugin. I find it odd that `:wincmd p` had cases where it wouldn't beep despite doing nothing, but it may be preferable to keep things that way (or instead also beep if curwin == prevwin, if that's preferred). - After more digging, I found cases in win_free_mem, enter_tabpage, aucmd_restbuf and qf_open_new_cwindow where curwin == prevwin is possible (many of them from autocommands). Others probably exist too, especially in places where curwin is changed temporarily. fixes: #14047 closes: #14186 Signed-off-by: Sean Dewar <6256228+seandewar@users.noreply.github.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Tue, 12 Mar 2024 21:00:11 +0100
parents 72aee06c1d78
children
line wrap: on
line source

#
# Makefile for converting the Vim tutorial on Windows.
#
# 21.11.23, Restorer, restorer@mail2k.ru


!IF [powershell -nologo -noprofile "exit $$psversiontable.psversion.major"] == 2
!ERROR The program "PowerShell" version 3.0 or higher is required to work
!ENDIF

# Common components
!INCLUDE Make_all.mak

# Correct the following line for the directory where iconv is installed.
# Please do not put the path in quotes.
ICONV_PATH = D:\Programs\GetText\bin

# In case some package like GnuWin32, UnixUtils, gettext
# or something similar is installed on the system.
# If the "iconv" program is installed on the system, but it is not registered
# in the %PATH% environment variable, then specify the full path to this file.
!IF EXIST ("iconv.exe")
ICONV = "iconv.exe"
!ELSEIF EXIST ("$(ICONV_PATH)\iconv.exe")
ICONV = "$(ICONV_PATH)\iconv.exe"
!ENDIF

RM = del /q
CP = copy /y
PS = PowerShell.exe

PSFLAGS = -NoLogo -NoProfile -Command

all : $(CONVERTED)

tutor.utf-8 : tutor
!IF DEFINED (ICONV)
	$(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@
!ELSE
	$(PS) $(PSFLAGS) [System.IO.File]::ReadAllText(\"$?\", \
		[System.Text.Encoding]::GetEncoding(28591)) ^| \
		1>nul New-Item -Force -ItemType file -Path . -Name $@
!ENDIF

tutor.bar : tutor.bar.utf-8
!IF DEFINED (ICONV)
	$(ICONV) -f UTF-8 -t ISO-8859-1 $? >$@
!ELSE
	$(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \
		[System.IO.File]::ReadAllText(\"$?\", \
		[System.Text.Encoding]::GetEncoding(65001)), \
		[System.Text.Encoding]::GetEncoding(28591))
!ENDIF

tutor.ca.utf-8 : tutor.ca
!IF DEFINED (ICONV)
	$(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@
!ELSE
	$(PS) $(PSFLAGS) [System.IO.File]::ReadAllText(\"$?\", \
		[System.Text.Encoding]::GetEncoding(28591)) ^| \
		1>nul New-Item -Force -ItemType file -Path . -Name $@
!ENDIF

tutor.de.utf-8 : tutor.de
!IF DEFINED (ICONV)
	$(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@
!ELSE
	$(PS) $(PSFLAGS) [System.IO.File]::ReadAllText(\"$?\", \
		[System.Text.Encoding]::GetEncoding(28591)) ^| \
		1>nul New-Item -Force -ItemType file -Path . -Name $@
!ENDIF

tutor.el : tutor.el.utf-8
!IF DEFINED (ICONV)
	$(ICONV) -f UTF-8 -t ISO-8859-7 $? >$@
!ELSE
	$(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \
		[System.IO.File]::ReadAllText(\"$?\", \
		[System.Text.Encoding]::GetEncoding(65001)), \
		[System.Text.Encoding]::GetEncoding(28597))
!ENDIF

tutor.el.cp737 : tutor.el.utf-8
!IF DEFINED (ICONV)
	$(ICONV) -f UTF-8 -t CP737 $? >$@
!ELSE
	$(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \
		[System.IO.File]::ReadAllText(\"$?\", \
		[System.Text.Encoding]::GetEncoding(65001)), \
		[System.Text.Encoding]::GetEncoding(737))
!ENDIF

tutor.eo : tutor.eo.utf-8
!IF DEFINED (ICONV)
	$(ICONV) -f UTF-8 -t ISO-8859-3 $? >$@
!ELSE
	$(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \
		[System.IO.File]::ReadAllText(\"$?\", \
		[System.Text.Encoding]::GetEncoding(65001)), \
		[System.Text.Encoding]::GetEncoding(28593))
!ENDIF

tutor.es : tutor.es.utf-8
!IF DEFINED (ICONV)
	$(ICONV) -f UTF-8 -t ISO-8859-1 $? >$@
!ELSE
	$(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \
		[System.IO.File]::ReadAllText(\"$?\", \
		[System.Text.Encoding]::GetEncoding(65001)), \
		[System.Text.Encoding]::GetEncoding(28591))
!ENDIF

tutor.fr.utf-8 : tutor.fr
!IF DEFINED (ICONV)
	$(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@
!ELSE
	$(PS) $(PSFLAGS) [System.IO.File]::ReadAllText(\"$?\", \
		[System.Text.Encoding]::GetEncoding(28591)) ^| \
		1>nul New-Item -Force -ItemType file -Path . -Name $@
!ENDIF

tutor.hr : tutor.hr.utf-8
!IF DEFINED (ICONV)
	$(ICONV) -f UTF-8 -t ISO-8859-2 $? >$@
!ELSE
	$(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \
		[System.IO.File]::ReadAllText(\"$?\", \
		[System.Text.Encoding]::GetEncoding(65001)), \
		[System.Text.Encoding]::GetEncoding(28592))
!ENDIF

tutor.hr.cp1250 : tutor.hr.utf-8
!IF DEFINED (ICONV)
	$(ICONV) -f UTF-8 -t CP1250 $? >$@
!ELSE
	$(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \
		[System.IO.File]::ReadAllText(\"$?\", \
		[System.Text.Encoding]::GetEncoding(65001)), \
		[System.Text.Encoding]::GetEncoding(1250))
!ENDIF

tutor.hu : tutor.hu.utf-8
!IF DEFINED (ICONV)
	$(ICONV) -f UTF-8 -t ISO-8859-2 $? >$@
!ELSE
	$(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \
		[System.IO.File]::ReadAllText(\"$?\", \
		[System.Text.Encoding]::GetEncoding(65001)), \
		[System.Text.Encoding]::GetEncoding(28592))
!ENDIF

tutor.hu.cp1250 : tutor.hu.utf-8
!IF DEFINED (ICONV)
	$(ICONV) -f UTF-8 -t CP1250 $? >$@
!ELSE
	$(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \
		[System.IO.File]::ReadAllText(\"$?\", \
		[System.Text.Encoding]::GetEncoding(65001)), \
		[System.Text.Encoding]::GetEncoding(1250))
!ENDIF

tutor.it.utf-8 : tutor.it
!IF DEFINED (ICONV)
	$(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@
!ELSE
	$(PS) $(PSFLAGS) [System.IO.File]::ReadAllText(\"$?\", \
		[System.Text.Encoding]::GetEncoding(28591)) ^| \
		1>nul New-Item -Force -ItemType file -Path . -Name $@
!ENDIF

tutor.ja.sjis : tutor.ja.utf-8
!IF DEFINED (ICONV)
	$(ICONV) -f UTF-8 -t CP932 $? >$@
!ELSE
	$(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \
		[System.IO.File]::ReadAllText(\"$?\", \
		[System.Text.Encoding]::GetEncoding(65001)), \
		[System.Text.Encoding]::GetEncoding(932))
!ENDIF

tutor.ja.euc : tutor.ja.utf-8
!IF DEFINED (ICONV)
	$(ICONV) -f UTF-8 -t EUC-JP $? >$@
!ELSE
	$(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \
		[System.IO.File]::ReadAllText(\"$?\", \
		[System.Text.Encoding]::GetEncoding(65001)), \
		[System.Text.Encoding]::GetEncoding(51932))
!ENDIF

tutor.ko.euc : tutor.ko.utf-8
!IF DEFINED (ICONV)
	$(ICONV) -f UTF-8 -t EUC-KR $? >$@
!ELSE
	$(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \
		[System.IO.File]::ReadAllText(\"$?\", \
		[System.Text.Encoding]::GetEncoding(65001)), \
		[System.Text.Encoding]::GetEncoding(51949))
!ENDIF

tutor.nl : tutor.nl.utf-8
!IF DEFINED (ICONV)
	$(ICONV) -f UTF-8 -t ISO-8859-1 $? >$@
!ELSE
	$(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \
		[System.IO.File]::ReadAllText(\"$?\", \
		[System.Text.Encoding]::GetEncoding(65001)), \
		[System.Text.Encoding]::GetEncoding(28591))
!ENDIF

tutor.no.utf-8 : tutor.no
!IF DEFINED (ICONV)
	$(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@
!ELSE
	$(PS) $(PSFLAGS) [System.IO.File]::ReadAllText(\"$?\", \
		[System.Text.Encoding]::GetEncoding(28591)) ^| \
		1>nul New-Item -Force -ItemType file -Path . -Name $@
!ENDIF

# nb is an alias for no
tutor.nb : tutor.no
	$(CP) tutor.no tutor.nb

tutor.nb.utf-8 : tutor.no.utf-8
	$(CP) tutor.no.utf-8 tutor.nb.utf-8

tutor.ru : tutor.ru.utf-8
!IF DEFINED (ICONV)
	$(ICONV) -f UTF-8 -t KOI8-R $? >$@
!ELSE
	$(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \
		[System.IO.File]::ReadAllText(\"$?\", \
		[System.Text.Encoding]::GetEncoding(65001)), \
		[System.Text.Encoding]::GetEncoding(20866))
!ENDIF

tutor.ru.cp1251 : tutor.ru.utf-8
!IF DEFINED (ICONV)
	$(ICONV) -f UTF-8 -t CP1251 $? >$@
!ELSE
	$(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \
		[System.IO.File]::ReadAllText(\"$?\", \
		[System.Text.Encoding]::GetEncoding(65001)), \
		[System.Text.Encoding]::GetEncoding(1251))
!ENDIF

tutor.sv.utf-8 : tutor.sv
!IF DEFINED (ICONV)
	$(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@
!ELSE
	$(PS) $(PSFLAGS) [System.IO.File]::ReadAllText(\"$?\", \
		[System.Text.Encoding]::GetEncoding(28591)) ^| \
		1>nul New-Item -Force -ItemType file -Path . -Name $@
!ENDIF

tutor.tr.iso9 : tutor.tr.utf-8
!IF DEFINED (ICONV)
	$(ICONV) -f UTF-8 -t ISO-8859-9 $? >$@
!ELSE
	$(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \
		[System.IO.File]::ReadAllText(\"$?\", \
		[System.Text.Encoding]::GetEncoding(65001)), \
		[System.Text.Encoding]::GetEncoding(28599))
!ENDIF

tutor.zh.utf-8 : tutor.zh.big5
	$(PS) $(PSFLAGS) [System.IO.File]::ReadAllText(\"$?\", \
		[System.Text.Encoding]::GetEncoding(950)) ^| \
		1>nul New-Item -Force -ItemType file -Path . -Name $@

clean :
	@for %%G in ($(CONVERTED)) do (if exist .\%%G ($(RM) %%G))

# vim: set noet sw=8 ts=8 sts=0 wm=0 tw=0 ft=make: