This helps the user know whether they are using a relatively untested
build and should consider going back to a main release. We currently
just define "pre-release" build as any release version with a minor
version, e.g. r176.1 is a pre-release, but r176 isn't.
Also, move the order around so we show "MacVim r123 (Vim
9.0.1234)" instead of "Vim 9.0.1234 (MacVim r123)" which is more
consistent with other ways we show version numbers, and this will be
how we show version number when we upgrade to Sparkle 2.4 as well.
MacVim's `:hardcopy` implementation just uses Preview to show the
generated PostScript file and lets the user decide what to do with it.
macOS 13 Ventura removed PostScript support from Preview, so we now have
to manually convert it to PDF first using `pstopdf` (which is thankfully
bundled with macOS).
While we are at it, update the script so that we actually delete the
file after sending it to Preview. Previously MacVim never did that and
therefore leaks the file in a temp folder until Vim closes, which isn't
ideal for privacy. Now, just set a 10 sec timer to delete the file after
it's opened (we just need enough time to allow Preview to open and load
the file, which doesn't take much time. The 10 sec timer is to account
for slow computers).
Fix#1347
Turn on parallel building, to remove the "Building targets in manual
order is deprecated" project warning.
Also, fix configure to only set macOS deployment target to the major
version of macOS when automatically setting it from the client OS
version. E.g. On macOS 13.2 it will set deployment to 13.0. This is
useful because usually we don't want it to be as granular as the minor
version which had caused issues in Homebrew before
(https://github.com/Homebrew/homebrew-core/issues/111693) where they had
to fix on their end, and also 13.2 ends up being too new for Xcode which
only expects to see up to 13.1 as deployment target.
- Note that the logic used to work in OSX 10.X days because the "minor"
version of X is actually the OS version, whereas in macOS 11/12/13 we
now have versions like 13.2 where the first number is now the OS
version. The configure script will now detect whether it's 10.X.Y or
X.Y (X != 10) and set the correct target correspondingly.
Set mouseshape correctly when using 'r' or 'gr'. Otherwise Vim will only
do it when mouse moves or window receives focus, which is a little
random. This change will be ported upstream.
Part of this was originally part of #1178 but we removed the qlstephen
parts to prepare for eventual removal. Couple years later and we haven't
removed qlstephen yet, so just fix the warnings for now first.
From #1178:
- Fix the project localization name from English to "en"
- Set ALWAYS_SEARCH_USER_PATHS to "NO"
Also:
- Remove the hard-coded macOS 10.8 deployment target which actually
isn't supported by modern Xcode versions. Just unset it as our CI
usually sets that for us.
- The post-build script is now tagged properly to always run.
- Ignore all deprecation warnings. These were exposed because we removed
the 10.8 deployment target. Since we aren't going to be fixing them
(we are either just going to grab newer versions from upsteram, or
delete this), there's no point in having these warnings.
Previously MacVim started to use the latest autoconf (2.71) but it's
best to match upstream in version to make it easier to diff/merge
changes, and also because the version upgrade is technically not 100%
backwards compatible.
Add an empty implementation to remove a diff from upstream, which
constantly shows up when resolving merge conflicts. We just make the
implementation empty because we already handle mouse hide in the MacVim
process using NSCursor instead, and don't need Vim's manual handling of
it.
Also, refactor test_macvim.vim a little.
In the CI setup, xcode-select is only called after the packages have
been set up, but during setup we actually need to build the packages
from source to have the correct deployment target linked correctly. This
means we could potentially be building with the wrong configuration
(e.g. when building for 10.9 legacy builds, we could be using an Xcode
version that's too new for that) when building gettext/libsodium. This
is compounded by the fact that our GitHub Action cache key for the
libraries only include the formula, but not the active Xcode version
itself so a cache could be propagated for a while until suddenly things
break.
To fix this, first make sure we do Xcode configuration early on in the
build, and to properly use the Xcode version as part of the cache key.
This way, when Xcode version changes, we will invalidate the cache and
rebuild gettext / libsodium with the correct configuration and if that's
wrong we will immediately fail the build instead of using old stale
caches.
Also, bump Xcode from 14.1 to 14.2 in CI.
Problem: Highlight for popupmenu kind and extra cannot be set.
Solution: Add PmenuKind, PmenuKindSel, PmenuExtra and PmenuExtraSel
highlight groups and use them. (Gianmaria Bajo, closes#12114)
MacVim's docs for 'fuoptions' above didn't terminate a code block which
resulted in the 'gdefault' help tags being broken as they were treated
as code blocks as well. Fix up the docs properly.
The Chinese alignment was slightly wrong when `columns` is even
numbered. Add an additional space to make sure it will line up right.
Also, for Spanish, just fix up the text to fit how the other intro help
texts look.
Also, don't hide the `:help version9` prompt in intro. For some reason
MacVim hides that prompt and shows the `:help macvim` prompt instead
which makes no sense. Just show both.
Fix#1380
Problem: "clear" macros are not always used.
Solution: Use ALLOC_ONE, VIM_CLEAR, CLEAR_POINTER and CLEAR_FIELD in more
places. (Yegappan Lakshmanan, closes#12104)
Problem: FOR_ALL_ macros are defined in an unexpected file.
Solution: Move FOR_ALL_ macros to macros.h. Add FOR_ALL_HASHTAB_ITEMS.
(Yegappan Lakshmanan, closes#12109)
The recent upstream Vim merge (v9.0.1365) contained a lot of refactoring
in the option setting code. Handling option setting was now done via a
standardized callback, with a struct `optset_T`. In resolving the
upstream merge conflicts, `did_set_fullscreen` was erroneously using the
wrong value from the union (should be using boolean instead of number)
which leads to it occasionally giving unpredictable results. Fix the
bug.
Note that the bug seems a little unpredictable since it depends on
compiler specifics. The only way it was known to trigger was by `set
diff` followed by `set fullscreen`.
Fix#1378
GitHub has a security tab that allows repos to manage their security
policy so it's not a bad idea ot be explicit in expectations. The policy
is to either use GitHub's builtin reporting system, or email MacVim's
team (in case that's the preferred method or the reporter does not want
to have a GitHub account). The most important thing is to not use the
public GitHub issue filing.
I don't think this will be used too much, but given that MacVim (and
Vim) can read arbitrary file, there is always a potential for a security
issue to pop up.
Problem: Function for setting options not used consistently.
Solution: Use a function for 'encoding' and terminal options. (Yegappan
Lakshmanan, closes#12099)
Problem: Wrong text displayed when using both 'linebreak' and 'list'.
Solution: Only set "c_extra" to NUL when "p_extra" is not empty. (Hirohito
Higashi, closes#12065)
Problem: Still some "else if" constructs for setting options.
Solution: Add a few more functions for handling options. (Yegappan
Lakshmanan, closes#12090)
Add "MACVIM REFERENCE" to syntax rule to reflect the new header to make
it look less weird. Also remove the "last changed date" header since I
rarely update it and it's not particularly useful given how in MacVim
the runtime is always bundled anyway.
Also, when investigating using Neovim's treesitter vim docs generating
tool for MacVim (to generate a web version of the documentation), found
a few typos / formatting issues. Fix them here.
Make sure to block testing 'winaltkeys' only if the option is supported.
Also, while we are at it, add a test to make sure MacVim-specific
options have proper error checking to prevent bad merge conflict
resolution from accidentally removing said logic.
With the release of Homebrew 4, auto-update is supposed to be more
efficient now. By removing the HOMEBREW_NO_AUTO_UPDATE env var from CI,
this will make sure that all the packages that we link to in CI will be
up to date instead of whatever just happens to be installed on the CI
environment which can sometimes fluctuate.
Previously, when configured with `--disable-sparkle`, the
Sparkle.framework would still get linked and copied into the app bundle.
This is because Xcode doesn't have an easy way to disable individual
build phase. We would either have to make a new build target, or
dynamically patch the project file in order for that to not happen.
Package managers like Homebrew and Nix have to either manually delete
the framework as a post-build step, or manually patch the pbxproj file
as a pre-build step to make sure the framework never got linked/copied.
Also, when building MacVim on macOS 10.9-10.12, where Sparkle 2 is not
supported, even if you build with `--disable-sparkle`, the app still
wouldn't run since Sparkle 2's framework still got copied into the app
and on launch the OS will detect that it's not compatible with the OS
version.
To fix this, just add a new env var and have the build cleanup script
delete the entire Sparkle.framework as a post-build step, if
`--disable-sparkle` was previously configured.
One thing to note is that currently, even with this, the MacVim binary
still has a weak linking dependency to the non-existent
Sparkle.framework (can be seen by doing `otool -L
MacVim.app/Contents/MacOS/MacVim`) but it should be fine. A proper way
to fix this is to manually link Sparkle instead of letting Xcode do it
for us, but considering that this is a relatively niche use case, and it
still works regardless, there isn't a pressing need to do so.
Also, add CI check to make sure when `--disable-sparkle` is used, the
actual MacVim binary has 0 references to Sparkle symbols. This makes
sure that removing the Sparkle.framework from the app bundle is actually
safe.
Problem: Too many "else if" statements in handling options.
Solution: Add more functions for handling option changes. (Yegappan
Lakshmanan, closes#12060)
This fixes build breaks on older Xcode versions (e.g. Xcode 8, on macOS
10.11). Fixes a couple issues:
- Vim's os_mac.h has an improperly specified backwards compatibility
ifdef (https://github.com/vim/vim/pull/10549). It's just checking for
existence of `MAC_OS_X_VERSION_10_12` instead of actually comparing it
against `MAC_OS_X_VERSION_MAX_ALLOWED`. The previous code that it was
fixing was comparing it against `MAC_OS_X_VERSION_MIN_REQUIRED` which
was also wrong as the "min" just means the deploy target, whereas the
"max" indicates the SDK you are compiling against.
- Unfortunately, the `@available` syntax for checking runtime version
was only introduced in Xcode 9. To make the code compilable in earlier
Xcode versions, introduce a new macro `AVAILABLE_MAC_OS` which will
use `@available` if compiling on Xcode 9+ (which is the vast majority
of cases), and use NSAppKitVersion checks on Xcode 8 or below. We
would like to still use `@available` checks if possible because the
compiler can optimize that out if it detects that you are deploying to
a higher target than what you are checking.
- Some typedefs in MacVim are also introduced in 10.13+. Add those
typedefs to MacVim.h
Fix#1342
Problem: Too many "else if" statements to handle option values.
Solution: Add more functions to handle option value changes. (Yegappan
Lakshmanan, closes#12058)
Currently when quitting MacVim, MMVimController will throw an exception
in `sendMessage:`. This is because MMAppController's handler for
quitting simply closes the connection, terminates the Vim processes and
quit; it doesn't individually shut down each Vim controller cleanly.
This is actually ok because we are quitting the app anyway, and it's not
terrible to just let the OS clean up (applicationWillTerminate also has
a 5 second executation timer set by macOS), but we do need to make sure
Vim controllers won't be trying to handle the now invalid connections.
Currently the exceptions will be caught by an exception handler, but
it's still not great, and could be confused with a bug, especially if
logging is enabled.
Add a way to set `isInitialized` to NO when shutting down, so that the
controllers will be blocked from trying to send connections.
Problem: No test for bad use of spaces in help files.
Solution: Add checks for use of spaces in help files. Ignore intentional
spaces. (Hirohito Higashi, closes#11952)
Problem: Crash when using buffer-local user command in cmdline window.
(Karl Yngve Lervåg)
Solution: Use the right buffer to find the user command. (closes#12030,
closes#12029)
Problem: Cursor in wrong position below line with virtual text below ending
in multi-byte character.
Solution: When checking for last character take care of multi-byte
character.
Problem: "gj" and "gk" do not move correctly over a closed fold.
Solution: Use the same code as used for "j"/"k" to go to the next/previous
line. (Luuk van Baal, closes#12007)
Problem: Crash when indexing "any" which is an object.
Solution: Check the index is a number. Do not check the member type of an
object. (closes#12019)
Problem: Checking the type of a null object causes a crash.
Solution: Don't try to get the class of a null object. (closes#12005)
Handle error from calling a user function better.
Problem: MS-Windows: vimfiles dir created with admin group.
Solution: Use ShellExecAsUser to create the vimfiles directory. (Christopher
Plewright, Ken Takata, closes#12000, closes#11888)
Problem: :messages behavior depends on 'fileformat' of current buffer.
Solution: Pass the buffer pointer to where it is used. (Mirko Ceroni,
closes#11995)
We are already removing the XPCServices folder in Sparkle 2 because it's
unnecessary for us, but there's a top-level symlink that still refers
to the folder, and its existence could potentially break automated
scripts and whatnot. Just clean it up and remove it as well in the
cleanup script.
Fix#1366
Problem: "$" for 'list' option displayed in wrong position when there are
text properties.
Solution: Adjust logic for order of displayed items. (closes#11959)
Problem: 'statusline' only supports one "%=" item.
Solution: Add support for multiple "%=" items. (TJ DeVries, Yegappan
Lakshmanan, closes#11970, closes#11965)
Problem: Inserting a register on the command line does not trigger
incsearch or update hlsearch.
Solution: Have cmdline_insert_reg() return CMDLINE_CHANGED when appropriate
and handle it correctly. (Ken Takata, closes#11960)
Problem: Calling an object method with arguments does not work. (Ernie
Rael)
Solution: Take the argument count into account when looking up the object.
(closes#11911)
Problem: :defer may call the wrong method for an object. (Ernie Rael)
Solution: When en object is from a class that extends or implements, figure
out the method to call at runtime. (closes#11910)
Updated to Vim 9.0.1276
Features
====================
Dictionary lookup
--------------------
You can now use Force Touch or Cmd-Ctrl-D to look up definitions of word
under the cursor (or selected text in visual mode). This will also
preview URLs, and support data types such as phone numbers and
addresses. #1312#1313
This feature can also be invoked programmatically from VimScript (see
`:h macvim-lookup`). #1315
Tool bar / Touch Bar / menu icons
--------------------
You can now use SF Symbols for Tool bar and Touch Bar icons, including
using different symbol styles such as "palette" or "multicolor". Menu
items can now also use the `icon=` syntax to specify icons as well. See
`:help macvim-toolbar-icon` for details. #1329
The default tool bar also has updated icons to look similar to SF
Symbols used by newer macOS versions. #1214 by @sfsam
Window management actions
--------------------
There are new `macaction`'s for managing the MacVim window. The new
`zoomLeft`/`zoomRight` actions allow you to pin the window to the
left/right of the screen, and there are also new actions for interacting
with Stage Manager (requires macOS 13+). See `:h macvim-actions` for
details. #1330
Pre-release updates / Sparkle 2
--------------------
MacVim now supports pre-release software builds. It's sometimes hard for
us to release frequent updates due to the desire to pick a stable
upstream Vim version, needing to test the release on multiple OS
versions, making sure there aren't half-complete or buggy features, and
other reasons.
This new feature now allows us to push pre-release beta builds out in a
more frequent fashion, which could be useful if there are particular
features or fixes that you would like to try out before the next
official release. Pre-release builds will be released depending on bug
fixes and features instead of a fixed cadence. Do note that these
pre-release builds may not be as well-validated and may have half-baked
features.
If you are using the built-in auto-updater to update MacVim, you can
turn this on by going to Advanced settings pane, and enable "Enable
pre-release software updates".
This feature is only available for macOS 10.13 or above.
The auto-updater has also been updated from Sparkle 1.27.1 to 2.3.0 for
10.13+ builds. Legacy (10.9-10.12) builds are still using Sparkle 1.
See #1332.
New Vim features
--------------------
New `smoothscroll` option allows you to scroll through a long wrapped
line (using Ctrl-E or mouse wheel) without immediately jumping to the
next line. (v9.0.0640)
`splitscroll` option has been renamed `splitkeep`, with more flexibility
than before. (v9.0.0647)
Sound playback on macOS is now supported. You can use `has('sound')` to
check. See `help sound` for details. (v9.0.0694)
Terminals now support `:confirm` for `:q`, etc, which also means
MacVim's Cmd-W will work properly for terminal windows. (v9.0.0710)
Virtual text had numerous bugs fixed.
General
====================
Legacy build for 10.9 - 10.12
--------------------
Per a previous announcement (#1271), the default MacVim binary will now
require macOS 10.13 or above. Users of macOS 10.9 - 10.12 can use a
separate "legacy" build which will still be supported. The legacy binary
will still have the latest versions of Vim and be supported, but may not
have all the latest features (e.g. pre-release builds).
If you are using the auto-updater (Sparkle) to update MacVim, it should
"just work" and find the best version for you. If you are downloading
MacVim from the website, there is also a link to download the legacy
version marked for 10.9+ as well. If you download the normal binary
marked for 10.13+ from the website, it won't work on these older macOS
versions.
See #1331.
Fixes
====================
CoreText Renderer clipping and rendering bugs
--------------------
Unicode characters with multiple composing characters (e.g. "x⃗") will
now render correctly. #1172
Texts (e.g. Tibetan, Zalgo texts) that are taller than the line height
will no longer be clipped inappropriately. You can use a new setting
`MMRendererClipToRow` to re-enable clipping if the tall texts are
distracting. #995 / #1356
Tab crash
--------------------
Fixed a crash when opening new tabs that seems to only occur in macOS 13
Ventura. #1333
Other bugs
--------------------
- Fixed non-native full screen not working well with the notch on newer
MacBook's when set to not show menu bar. You can also use
`MMNonNativeFullScreenSafeAreaBehavior` to force MacVim to use the
notch area as well if you don't mind some content being obscured. Note
that the previous release also claimed it fixed this, but because the
binary was built against an old macOS SDK (Big Sur), the fix did not
work in the binary release. #1261
- Allow "Open untitled window: never" and "After last window closes:
Quit MacVim" to be set together again. Added safeguards to make sure
doing so won't immediately close the app. #1338
- Edit.Cut / Copy menu items will now be properly disabled when there
isn't selected text. #1308
- Fixed potential `:emenu` crash when the menu is associated with an
action in a non-valid mode. #1305
- Fixed bug where just bringing up the right-click (or the
MacVim→Services) menu would somehow copy the selected texts to the
system clipboard. #1300
- Fixed a Japanese input method bug where using left/right arrow to move
to a different section of the input text would previously result in
the candidate list not showing up at the correct position. #1312
- Fix non-CoreText renderer not handling text styles like strikethrough
correctly (note: this renderer has been deprecated for a while and you
should not use it). #1296
- This release uses an older sh/bash syntax file because the latest one
in Vim has a bug. #1358
Misc
====================
New settings:
- "No drop shadows" (Appearance). #1301
- "Treat Ctrl-click as right-click" (Input) (#1326). This was previously
configurable via command-line, but now also possible in the settings
pane under the new "Input" category.
"About MacVim" now reports the version number in a clearer way with
clearly specified release number vs Vim version.
Known Issues
====================
Printing
--------------------
Printing using File→Print or `:hardcopy` is currently not working under
macOS 13 Ventura due to its removal of PostScript support in the Preview
app. This will be fixed in a later release. See the issue for
workarounds. #1347
Scripting
====================
- Scripting languages versions:
- Perl is now built against 5.30, up from 5.18.
- Ruby is now built against 3.2, up from 3.1.
Compatibility
====================
Requires macOS 10.9 or above. (10.9 - 10.12 requires downloading a
separate legacy build)
Script interfaces have compatibility with these versions:
- Lua 5.4
- Perl 5.30
- Python2 2.7
- Python3 3.10
- Ruby 3.2
Similar to #1334. The old PSMTabBarControl code has a lot of dubious
straggling states regarding the tracking tags. Seems like previous macOS
versions tolerated that but in the newer macOS versions, the tags seem
to be reused for other purposes and so when you double-remove the tags,
you get into trouble.
Related to #1333
Currently, it's hard to embed video in the release notes shown to
Sparkle, because by default it disables JavaScript, which video tags
need in order to work properly for the WebKit embedded browser. Turn it
on, so that we can show video instead of animated GIF's in the future
for release notes.
I don't think there should be any serious security issues after thinking
about it. The browser is sandboxed and we are serving this through https
anyway.
We previously removed the --deep flag from signing, which missed one of
the executable within Sparkle 1 that we need to sign expicitly (Sparkle
1 is still used for legacy builds).
The latest Vim runtime update upgraded sh.vim from version 204 to 205,
which contains a bug (https://github.com/vim/vim/issues/11937). Since we
are releasing MacVim soon, simply revert this change to have a stable
build and we will revert this when Vim has fixed this upstream.
Use a better format for the version reporting in the "About MacVim" page
to be clear what's the Vim version, and what's specifically the MacVim
release number.
Also, store the last used MacVim version number. This isn't used right
now but may be used later for showing up a "What's New" page when
updating to a new version, primarily for non-Sparkle users (e.g.
Homebrew builds) so they can still be notified when something changed.
Storing this number now allows us to know in a later build whether the
user has upgraded to the build or starting a new build from fresh (where
we may not want to show the "What's New" page as everything would be
new).
Part of addressing #1293
Problem: .clangd and .stylelintrc files don't get a filetype.
Solution: Use yaml for .clangd and json for .stylelintrc files. (Mark
Skelton, closes#11916)
Problem: The did_set_string_option function is too long.
Solution: Further cleanup of handling string options. (Yegappan Lakshmanan,
Lewis Russell, closes#11920)
Problem: The did_set_string_option function is too long.
Solution: Split off functionality to individual functions. (Yegappan
Lakshmanan, Lewis Russell, closes#11904)
This fixes the issue where particularly tall characters will get clipped
at the row boundary. This happens because even though a font describes
the line height with font metrics, individual glyphs do not have to
respect them, and we can see with emoji rendering sometimes they can
poke upwards past the line height. Also, it's trivially easy to
construct composing characters that become really tall, e.g. "x゙̂⃗", or
Tibetan scripts like "ཧཱུྃ".
To fix this, we do the following:
1. Remove the explicit clipping call at rendering.
2. Fix partial redraw to not lead to clipping / corruption. This is
quite tricky, because let's say we have a character that is tall
enough to touch other lines, if those lines are redraw but not the
line with the tall char, the redraw will paint over the parts of the
glyphs poking through. Alternatively if we redraw the line with the
tall chars we also need to expand the redraw region to make sure
other lines get repainted as well. To fix this properly, we should do
a proper glyph calculation when we receive the draw command before we
issue before we call `setNeedsDisplayInRect`, but since right now we
only extract glyph info later (during drawRect call), it's too late.
We just do the hacky solution by storing a variable
`redrawExpandRows` that tracks how many lines to expand for all
lines. It's a little hacky since this will affect all lines
permanently regardless if they have tall characters or not. The
proper fix may come later as an optimization (or when we do hardware
rendering via Metal).
3. Re-order the rendering so we have a two pass system, where we first
draw the background fill color for all rows, then the text. This
helps prevent things like Vim's window split or cursorline from
obscuring the text.
4. Add a preference to turn on clipping (old behavior). This helps
prevent odd issues with really tall texts (e.g. Zalgo text) making it
hard to see what's going on. The preference `MMRendererClipToRow` is
not exposed in UI for now as it's a relatively niche. It will be
exposed later when we have a dedicated render tab in settings.
Note that a lot of these characters only show their full height by doing
`set maxcombine=8` because the default (2) is quite low.
Part of the fix for #995
MacVim previously didn't really render composing characters with
multiple glyphs correctly. For simple ones like 'â' it would work fine
because Core Text just generates one glyph for it, but for more
complicated ones like 'x⃗' the renderer didn't properly query the advance
of the glyphs to put them at the correct position. Refactor the logic to
keep track of the current cell/glyphs and make sure to track the
advances fo the glyphs so the composing chars' glyphs would be laid out
properly on top of the cell.
We need to be careful with the tracking, because in Vim we force the
text rendering to be monospaced, and so we maintain the tracking within
a single grapheme (which can consist of multiple glyphs), but when we
move to the next grapheme we reset the position so we can get proper
monospaced rendering even for non-monospaced texts like CJK or stylized
texts.
Fix#995Fix#1172
I have looked and I do not believe there is a good reason to do this
rounding up at all. I believe the motivation is to align the baseline
with the pixel boundary, but I don't believe that is necessary, given
that Core Text will properly perform the correct antialiasing for us.
Most texts aren't directly aligned at the baseline anyway. Before, that
ceil() option is a reason why sometimes fonts would feel pushed upwards,
clipping emojis to the top, and creating a lopsided effect for fonts
like Fira Code (h11), since we draw the boxes aligned to the line
height at the bottom of the descender, meaning the ceil() has an effect
of pushing the text up.
The setting was added to "preserve" the font's original line spacing
intents, but after further investigation I cannot find why Apple's
calculation for font line spacing to be so wide. Furthermore it's quite
odd because the default line spacing is wide, but the only thing that
setting does is by re-initializing the font under Core Text (instead of
using NSFont like the default) using CTFont and somehow the issue is
fixed. Inspecting font metrics (using ttx) also didn't seem to give any
hints why the spacing are so wide (e.g. ascent / descent / line gap etc
all look fine). A StackOverflow comment seems to suggest that Apple is
simply adding a 1.2x scale to some fonts
(https://stackoverflow.com/questions/5511830/how-does-line-spacing-work-in-core-text-and-why-is-it-different-from-nslayoutm)
which seems to match the observation. My guess is that Apple looks at
some fonts and think they are too aggressive in their font metrics
design and "helpfully" introduces a 1.2x multiplier to space them out,
where Core Text is lower level than AppKit and therefore does not have
this auto-inflation.
By renaming the option it should make it clearer that this is a somewhat
arbitrary distinction instead of it being an inherent property of the
font.
Problem: MS-Windows: scrollback cropped off on Vim exit.
Solution: Don't call SetConsoleScreenBufferInfoEx when using the alternate
screen buffer. (Christopher Plewright, closes#11882)
Problem: Cursor briefly displayed in a wrong position when pressing Esc in
Insert mode after autoindent was used.
Solution: Do not adjust the cursor position for assumed deleted white space
if text is following. (closes#11877)
Problem: Cannot access a private object member in a lambda defined inside
the class.
Solution: Go up the context stack to find the class. (closes#11866)
Problem: :runtime completion can be further improved.
Solution: Also complete the {where} argument values and adjust the
completion for that. (closes#11874)
Problem: Spurious empty line when using text propertie and virtual text.
Solution: Do not set "text_prop_follows" when the other text property is not
virtual text. (closes#11846)
Problem: Termcap/terminfo entries do not indicate where modifiers might
appear.
Solution: Add ";*" for function keys where modifiers are likely to be used.
Problem: Using isalpha() adds dependency on current locale.
Solution: Do not use isalpha() for recognizing a URL or the end of an Ex
command. (closes#11835)
Problem: Adding a line below the last one does not expand fold.
Solution: Do not skip mark_adjust() when adding lines below the last one.
(Brandon Simmons, closes#11832, closes#10698)
Problem: Testing with Python on AppVeyor does not work properly.
Solution: Fix typo. Move most lines to the .bat file. (Christopher
Plewright, closes#11828)
Problem: Crash when handling class that extends another class with more
than one object members.
Solution: Correct pointer computations. (closes#11824)
Problem: Screen is not redrawn after using setcellwidths().
Solution: Redraw the screen when the cell widths have changed. (Yasuhiro
Matsumoto, closes#11800)
Problem: Some key+modifier tests fail on some AppVeyor images.
Solution: Adjust the tests for key movements and fix the revealed bugs.
(Christopher Plewright, closes#11798)
Problem: Evaluating string expression advances function line.
Solution: Disable function lines while parsing a string expression.
(Hirohito Higashi, closes#11796)
Problem: Configure does not handle all FORTIFY_SOURCE variants.
Solution: Also handle Fedora's default FORTIFY_SOURCE flags. (Zdenek Dohnal,
closes#11794)
Problem: Class "implements" argument not implemented.
Solution: Implement "implements" argument. Add basic checks for when a
class implements an interface.
Problem: MS-Windows: various special keys and modifiers are not mappable.
Solution: Adjust the handling of keys with modifiers. (Christian Plewright,
closes#11768)
Problem: Crash and/or memory leak when redefining function after error.
Solution: Clear pointer after making a copy. Clear arrays on failure.
(closes#11774)
Problem: 'cursorcolumn' and 'colorcolumn' wrong after concealing and
wrapping line.
Solution: Reset "wlv.vcol_off" after each screen line. (Alexey Radkov,
closes#11777)
When adding support for gettext in #1070, a MacVim-specific ifdef was
added unnecessary around `bindtextdomain`. That ifdef isn't actually
necessary and it seems to have been done due to an incorrect
understanding of the ifdef logic there regarding `FEAT_GETTEXT`. Just
remove it to clean it up. Localization should still work.
Problem: Unexpected output when autoloading a script for an interactive
operation.
Solution: Reset "KeyTyped" while loading a script and when handling a nested
function. (closes#11773)
Problem: Virtual text at a column position is truncated at the window edge.
(Yegappan Lakshmanan)
Solution: Do not truncated virtual text that is placed at a column.
Problem: Cursor positioning and display problems with 'smoothscroll' and
using "zt", "zb" or "zz".
Solution: Adjust computations and conditions. (Yee Cheng Chin,
closes#11764)
Problem: Terminfo entries for bracketed paste are not used.
Solution: Use the newly added terminfo entries for bracketed paste.
Correct mixup of output strings and key codes.
Problem: A hashtab with many removed items is not cleaned up.
Solution: Re-hash a hashtab even when the size didn't change if too many
items were removed.
Problem: Search error message doesn't show used pattern.
Solution: Pass the actually used pattern to where the error message is
given. (Rob Pilling, closes#11742)
Problem: Assignment to non-existing member causes a crash. (Yegappan
Lakshmanan)
Solution: Give an error message and bail out when a member cannot be found.
Problem: Display wrong in Windows terminal after exiting Vim.
Solution: Apply screen restore fix for Windows 11 also to Windows 10 builds.
(Christopher Plewright, closes#11713, closes#11706)
Problem: Code handling low level MS-Windows events cannot be tested.
Solution: Add test_mswin_event() and tests using it. (Christopher Plewright,
closes#11622)
Problem: The "kitty" terminfo entry is not widespread, resulting in the
kitty terminal not working properly.
Solution: Go back to using "xterm-kitty" and avoid the problems it causes in
another way.
Problem: Can add text property with negative ID before virtual text
property.
Solution: Remember that a text property with a negative ID was used and give
an appropriate error message. (closes#11725)
Fix index computation.
Problem: Using "xterm-kitty" for 'term' causes problems.
Solution: Remove the "xterm-" part when 'term' is set from $TERM. Detect a
few kitty-specific properties based on the version response
instead of the terminal name.
Problem: No information about whether requesting term codes has an effect.
Solution: Add ch_log() calls to report the effect of term code responses.
Avoid deleting an entry and then adding back the same one.
Problem: A shell command switching screens may still have a problem with
the kitty keyboard protocol.
Solution: Disable the kitty keyboard protocol both in the current and the
alternate screen, if there are indications it might be needed.
(issue #11705) Also fix naming.
Problem: Code for making 'shortmess' temporarily empty is repeated.
Solution: Add functions for making 'shortmess' empty and restoring it.
(Christian Brabandt, closes#11709)
Problem: When using Kitty a shell command may mess up the key protocol
state.
Solution: Output t_te before t_TE. If t_te switches between the main and
the alternate screen then deactivating the key protocol by t_TE
should happen after switching screen. (issue #11705)
Problem: Some test function names do not match what they are doing.
Solution: Leave out user data for the test that is called "NoUserData".
(closes#11703)
Problem: Build failure with some compilers that can't handle a
declaration directly after a "case" statement.
Solution: Add a block to put the declarations in.
Problem: Conflict between supercollider and scala filetype detection.
Solution: Do not check for "Class : Method", it can appear in both
filetypes. (Chris Kipp, closes#11699)
Problem: Object member can't get type from initializer.
Solution: If there is no type specified try to use the type of the
initializer. Check for a valid type.
Problem: With "screenline" in 'culopt' cursorline highlight is wrong.
Solution: Apply the priority logic also when "screenline is in 'culopt'.
(closes#11696)
Problem: Using a <Cmd> mapping CmdlineChanged may be triggered twice.
Solution: Count the number of times CmdlineChanged is triggered and avoid
doing it twice. (closes#116820
Problem: lalloc(0) error for a class without members.
Solution: Don't allocate room for members if there aren't any.
Don't create the class if there was an error.
Problem: Mouse shape test is flaky, especially on Mac OS.
Solution: Instead of starting all timers at the same time, start the next
one in the callback of the previous one. (Yee Cheng Chin,
closes#11673) Also use "bwipe!" instead of "close!" to avoid
swap files remaining.
Problem: 'smoothscroll' and virtual text above don't work together.
(Yee Cheng Chin)
Solution: Skip virtual text above when w_skipcol is non-zero.
(closes#11665)
Problem: There is no way to get a list of swap file names.
Solution: Add the swapfilelist() function. Use it in the test script to
clean up. Remove deleting individual swap files.
Problem: Classes are not documented or implemented yet.
Solution: Make the first steps at documenting Vim9 objects, classes and
interfaces. Make initial choices for the syntax. Add a skeleton
implementation. Add "public" and "this" in the command table.
Problem: If 'keyprotocol' is empty "xterm" still uses modifyOtherKeys.
Solution: Remove t_TI, t_RK and t_TE from the "xterm" builtin termcap and
let the default value of 'keyprotocol' add those.
Problem: Display errors when adding or removing text property type.
Solution: Perform a full redraw. Only use text properties for which the
type is defined. (closes#11655)
Problem: Crash when reading help index with various options set. (Marius
Gedminas)
Solution: Do not set wlv.c_extra to NUL when wlv.p_extra is NULL.
(closes#11651)
Problem: Callback name argument is changed by setqflist().
Solution: Use the expanded function name for the callback, do not store it
in the argument. (closes#11653)
Problem: When using kitty keyboard protocol function keys may not work.
(Kovid Goyal)
Solution: Recognize CSI ending in [ABCDEFHPQRS] also when the termcap
entries are not specified. (closes#11648)
Problem: The keyboard state response may end up in a shell command.
Solution: Only request the keyboard protocol state when the typeahead is
empty, no more commands are following and not exiting. Add the
t_RK termcap entry for this.
Problem: It is not easy to see what client-server commands are doing.
Solution: Add channel log messages if ch_log() is available. Move the
channel logging and make it available with the +eval feature.
Problem: Kitty keyboard protocol key not decoded when it has an unsupported
modifier, such as NumLock.
Solution: Accept a key with any modifier. (closes#11638)
Problem: Matchparen highlight is not updated when switching buffers.
Solution: Listen to the BufLeave and the BufWinEnter autocmd events.
(closes#11626)
Problem: Status line of other window not redrawn when dragging it when
'splitkeep' is set to "screen".
Solution: Set w_redr_status earlier. (Luuk van Baal, closes#11635,
closes#11632)
Problem: Error when using the "Tools / Spelling / Find More Languages"
menu.
Solution: Remove "<SID>". Reset "g:menutrans_set_lang_to" when 'encoding'
changes. (closes#11625)
Problem: Cannot detect whether modifyOtherKeys is enabled.
Solution: Use XTQMODKEYS introduced by xterm version 377 to request the
modifyOtherKeys level. Update the keycode check results.
Problem: Pretending to go out of Insert mode when Esc is received has side
effects.
Solution: When the kitty keyboard protocol is enabled expect Esc to always
be the start of an escape sequence.
Problem: Crash when typing a letter in a terminal window. (Shane-XB-Qian)
Solution: Use the "vterm" variable instead of getting the terminal pointer
from the current buffer. (closes#11608)
Problem: Still using simplified mappings when using the kitty keyboard
protocol.
Solution: Use the kitty_protocol_state value to decide whether to use
simplified mappings. Improve how seenModifyOtherKeys is set and
reset.
Problem: MS-Windows: mouse column limited to 223.
Solution: Use two bytes for each mouse coordinate. Add the mouse position
to scroll events. (Christopher Plewright, closes#11597)
Problem: Cannot debug the Kitty keyboard protocol with TermDebug.
Solution: Add Kitty keyboard protocol support to the libvterm fork.
Recognize the escape sequences that the protocol generates. Add
the 'keyprotocol' option to allow the user to specify for which
terminal what protocol is to be used, instead of hard-coding this.
Add recognizing the kitty keyboard protocol status.
Problem: Two conditions are always false.
Solution: Remove the conditions. Update return value types to make clear
what could be returned. (closes#11593)
Problem: Second SIGWINCH signal may be ignored.
Solution: When set_shellsize() is busy when called then run the inner code
again when it's done. (issue #424)
Problem: MS-Windows: modifier keys do not work with mouse scroll events.
Solution: Use K_SPECIAL instead of CSI for the modifier keys. (Christopher
Plewright, closes#11587)
Problem: Only a change in the current window triggers the WinScrolled
event.
Solution: Trigger WinScrolled if any window scrolled or changed size.
(issue #11576)
Problem: libvterm with modifyOtherKeys level 2 does not match xterm.
Solution: Adjust key code escape sequences to be the same as what xterm
sends in modifyOtherKeys level 2 mode. Check the value of
no_reduce_keys before using it.
Problem: With 'smoothscroll' cursor is one screen line too far down. (Ernie
Rael)
Solution: Add a test that currently has the wrong result so that a fix can
be made. (issue #11436)
Problem: Test for home key fails when 'term' is "tmux".
Solution: Only save termcap entries that exist. Adjust code for xHome to
what xterm uses. (closes#11566)
Problem: Virtual text property highlight ignores window background.
Solution: Combine text prop attribute with win_attr into extra_attr.
(closes#11462)
Problem: May redraw when not needed, causing slow scrolling.
Solution: Do not redraw when w_skipcol doesn't change. When w_skipcol
changes only redraw from the top. (issue #11559)
Problem: Keycode check script has a few flaws.
Solution: Sort on terminal name. Ignore XTGETTCAP responses. Check for
version and status response. Update entries.
Problem: MS-Windows GUI: CTRL-] does not work on Swiss keyboard.
Solution: Check the key code and don't consider it as a dead key. (Aedin
Louis Xavier, closes#11556)
Problem: Cannot easily try out what codes various keys produce.
Solution: Add a script to gather key code information, with an initial list
of codes to compare with.
Problem: Horizontal mouse scroll only works in the GUI.
Solution: Make horizontal mouse scroll also work in a terminal.
(Christopher Plewright, closes#11448)
Problem: A silent mapping may cause dots on the command line.
Solution: Don't show dots for completion if they are not going to be removed
again. (closes#11501)
Problem: Get E967 when using text property in quickfix window. (Sergey
Vlasov)
Solution: Do not add an extra NUL and compute the text length correctly.
(closes#11513)
Problem: MS-Windows: after Vim exits console resizing does not work
properly.
Solution: Restore screen behavior checks for various WT and VTP
combinations. (Christopher Plewright, closes#11526,
closes#11507)
Problem: Duplicate arguments are not always detected.
Solution: Expand to full path before comparing arguments. (Nir Lichtman,
closes#11505, closes#9402)
Problem: col() and charcol() only work for the current window.
Solution: Add an optional winid argument. (Yegappan Lakshmanan,
closes#11466, closes#11461)
Problem: Solution for "!!sort" in closed fold is not optimal.
Solution: Use a different range instead of the subtle difference in handling
a range with an offset. (issue #11487)
Problem: MS-Windows Terminal has unstable color control.
Solution: Do not try to read the old command prompt colortable, use modern
VT sequences. (Christopher Plewright, closes#11450,
closes#11373)
Problem: Shell command with just space gives strange error.
Solution: Skip white space at start of the argument. (Christian Brabandt,
Shane-XB-Qian, closes#11515, closes#11495)
Problem: Handling 'statusline' errors is spread out.
Solution: Pass the option name to the lower levels so the option can be
reset there when an error is encountered. (Luuk van Baal,
closes#11467)
Add CI test to confirm desired Vim features like +sound / etc exist.
Smoketest also checks for libsodium now by trying to set xchacha20
cryptmethod which can only succeed if sodium is enabled. Also make sure
it's actually checking the scripting language bindings are working
properly. Previously for some reason it wasn't checking the print
results.
Problem: The window title is not redrawn when 'endoffile' changes.
Solution: redraw the window title when 'endoffile' is changed. (Ken Takata,
closes#11488)
Previously we disabled this combo in f6ba7dd40b because when
implemented naively, it causes an issue where just opening an About
MacVim or Settings window could immediately cause MacVim to exit
(because macOS determined that there were no non-auxillary window open).
This was awkward and potentially made it hard to change the setting
back, and exact behavior depended on OS behavior.
However, it seems like there are legit use case for this combo of
settings. Change it so that we allow setting both of them again, but add
checks so that `applicationShouldTerminateAfterLastWindowClosed:` will
only return `YES` if we have opened at least one Vim window before. This
gives the user a chance to open a window first, so using Settings etc
wouldn't immediately terminate the app.
Fix#1338
Sparkle 2:
Seems like older Xcode versions (before 12.5) have problems signing
frameworks that only have a Versions/B but not a Versions/A folder.
Sparkle 2 moved to only having Versions/B which is causing code sign to
fail on build step. Just fix this issue by disabling Sign on Copy for
Sparkle.framework. We don't really need it because it already comes with
an ad-hoc signature anyway, and for publish we have a custom signing
script (sign-developer-id) to do manual signing.
Also, fix CI to use Sparkle 2 again for old Xcode (11.7) builds to test
this working. Previously we made it use Sparkle 1 because we didn't work
around this issue, which was kind of a hack.
For Sparkle 2, also add a `cleanup-after-build` script to remove the XPC
Services folder in the framework. Sparkle dev added this to the bundle
for sandboxed apps but non-sandbox apps don't really need it and it's
recommended by Sparkle to remove them, so we unfortunately need to
manually do it as a post-build step.
Fix#1335
Signing / notarization scripts:
Make sure to sign Sparkle 2 binaries in `sign-developer-id`. Also, seems
like the "--deep" flag in codesign is now deprecated as of macOS 13, so
just stop using it and manually sign all the relevant binaries
explicitly.
For notarization script, the current behavior doesn't correctly detect
failure as `xcrun notarytool submit` always exits with 0 even if the
submission failed. Add logic to manually query whether the submission
succeeded. If failed, print out the logs for easier diagnosis, and
exits with -1 so it will block progress.
This seems to be a really old bug but new interactions with macOS
(probably due to macOS 13 Ventura) caused it to surface and crash.
Previously it was assuming a call to removeTrackingRect must always come
only after addTrackingRect was called, which was not a good assumption
to make. As a result, we could call this and end up triggering other
code in macOS when passing in a 0 tracking tag.
Fix#1333
Add a new option for the user to opt-in for getting pre-release
software. When turned on, Sparkle will accept a new "prerelease" channel
for updates.
This feature only works in Sparkle 2, which means legacy binaries
(10.9-10.12) which use Sparkle 1 won't get this. It's possible to
implement this for Sparkle 1 but we would need to do so in a completely
different (and more annoying) manner of using two separate appcast XML
files and switch among them. Given the niche nature of legacy binaries,
this is not worth doing.
The setting is in the Advanced settings pane because the pre-release
builds aren't guaranteed to be stable or well-tested, so we don't want
users to turn it on unless they looked for it. For terminology, went
back and forth on "beta", "preview", "pre-release", and eventually
settled on "pre-release" builds which also lines up with GitHub
Release's convention.
Use the updated API (SPUStandardUpdaterController instead of SUUpdater).
Old functionality now use a USE_SPARKLE_1 compiler define to switch to
old behavior when building for legacy builds.
Add a delegate class that we can use to customize Sparkle behavior.
Also, make sure DISABLE_SPARKLE will prevent including headers as well
- Previously it was a mistake to keep including the headers. Now it should
be completely de-coupled.
Add a configure flag to set the USE_SPARKLE_1 ifdef flag. In CI legacy
builds, we will relink the symlink to point to Sparkle_1.framework and
also call that configure flag so the code will build.
This adds Sparkle 2 to the project add changes the symlink to point to
it. This version has changed the min OS requirement from 10.9 to 10.13,
and as such we keep the old Sparkle 1 around, and during CI, we swap to
it when building legacy binary (regular MacVim has minOS set to 10.13,
while legacy has min OS set to 10.9).
SDK for the new macOS 13 (released as part of Xcode 14.1) increased the
minimum deployed OS from 10.9 to 10.13. Since we still want to support
a minimum OS requirement of 10.9, while building against the latest SDK
to get the most up-to-date features, we have to split the build process
to build two separate binaries. A regular MacVim that targets the macOS
13 SDK (with min OS target 10.13), and a "legacy" MacVim that targets
the macOS 12 SDK (with min OS target 10.9).
Change the GitHub Action CI config to have two separate matrix entries
that publish, with one having a "legacy" flag set, which will use the
older version of Xcode and the correct env vars set. It will also only
build for x86-64 (no arm64) since currently all Apple Silicon hardware
can run the latest versions of macOS and would have no need to run
legacy builds.
Also, fix some scripting issues:
- fix Python 2 library path set incorrectly
- Update Perl to 5.30 from 5.18, as 5.18 is no longer installed in macOS
13. We could potentially change Perl to use the Homebrew version
instead similar to how Python and other scripting languages are done
but for now this works fine (except it won't work on older macOS
versions). Perl is a rarely used language for Vim plugins.
See https://github.com/macvim-dev/macvim/discussions/1288
Problem: The <Home> key in tmux doesn't work when 'term' is set to "xterm".
(Dominique Pellé)
Solution: Only use '@' in a termcap key entry for "1" when ";" follows.
(closes#11429)
Problem: If 'endofline' is set the CTRL-Z may be written in the wrong
place.
Solution: Write CTRL-Z at the end of the file. Update the help to explain
the possibilities better. (Ken Takata, closes#11486)
Problem: Mouse drag test fails.
Solution: Only reset the mouse click flag when actually switching to another
tab page. Disable test that keeps failing.
New zoomLeft/Right actions let the user easily pin the MacVim window to
the left/right of the screen using the private APIs _zoomLeft: /
_zoomRight:. This is similar to Windows' Aero Snap mode, and the
functionality has been in macOS since 10.15. Unfortunately there isn't a
public API for calling this.
Note that this could already be done if the user went to the Keyboard
settings and added a shortcut key to the Window -> "Move Window to Right
Side of Screen" menu, but I doubt a lot of people do that, and it's
nicer to have script-level control of this. The other likely option
users would have adopted is to use a third-party tool. This change
mostly makes it possible to easily snap the windows without needing to
use them.
Also, add new macOS 13 Ventura hooks for interfacing with Stage Manager.
Expose the `_removeWindowFromStageManagerSet:`, which is the private API
behind the new "Remove Window from Set" menu item, which removes the
window from a mixed application set in Stage Manager. Similar to
_zoomLeft:, this is a UI-only feature, and hence no public API is
avaialble. Also, expose the collections API so that we can call
join/unjoinAllStageManagerSets: to have MacVim windows float among all
Stage Manager sets, which is useful for windows that need to show up
next to other windows (e.g. a copy-and-paste scratchpad file).
Also add a new separator to the Window menu because macOS injects all
the window/Stage Manager related menu items right after the "Zoom" item,
and it kind of expects a separator to be right after it for the new
items to be categorized right.
Can now specify SF Symbols for tool bar / Touch Bar icons. The API
remains the same where we use the "icon=" syntax in Vim menus to specify
the icon, and just passing in the symbol name (e.g. 'gear.circle'). Also
extended this to system named images like 'NSAdvanced' (the old gear
shaped image), as previously we only had a specical case for Touch Bar
system named template images. When loading the icon, MacVim will
automatically determine whether it's an SF Symbol, system named image,
or a file.
SF Symbols can also be customized to be of a particular symbol style, or
have a variable number set, by using colon-delimted option strings. For
example: `aqi.high:palette:variable-0.5` is a symbol that uses the
palette style, set to 0.5 variable value.
Menu items now also support icons, the same as tool bars. We still don't
support specifying icons for a submenu (which has been an issue for
Touch Bar) since the Vim menu API doesn't support a way to do so.
Also add an ability to use a `:template` value to specify that an image
file is a template image. This is important to fix a minor regression
introduced in #1214 where every image loaded in were assumed to be
template.
Add documentation to make this clear. See `:help macvim-toolbar-icon`.
Also see comment in #1105 which requested this feature
Fix failure in Test_popup_command. The test assumes a certain PopUp menu
layout but we recently added a new "Look Up" menu item. Make sure the
test removes those non-standard menu items before progressing the test.
Also, while we are at it, make sure the showdefinition() command will
fail when not in GUI mode so it doesn't queue up the command queue.
Also, convert the E??? error codes to proper error codes (and using a
postfix "-M" to make sure they don't conflict with future Vim error
codes) so they can be looked up in documentation.
In macOS 13 Ventura, the general terminology of "Preferences" has been
renamed to "Settings". The main menu's "Preferences…" item is
automatically renamed to "Settings…" by the OS when building against the
macOS 13 SDK, but we still need to update documentation to match.
Problem: Kitty terminal is not recognized.
Solution: Recognize Kitty by the termresponse and then do not set
seenModifyOtherKeys, since Kitty doesn't support that.
(issue #11413)
Problem: With 'smoothscroll' typing "0" may not go to the first column.
Solution: Recompute w_cline_height when needed. Do not scroll up when it
would move the cursor.
Problem: 'langmap' works differently when there are modifiers.
Solution: Only apply 'langmap' to a character where modifiers have no
effect. (closes#11395, closes#11404)
Problem: The modifyOtherKeys flag is set when it should not.
Solution: Do not handle special key codes with a modifer value above 16 as a
modifyOtherKeys value. (issue #11403)
Problem: MS-Windows: mouse scroll events only work with the dll.
Solution: Accept CSI codes for MS-Windows without the GUI. (Christopher
Plewright, closes#11401)
Problem: At the hit-Enter prompt the End and Home keys may not work.
Solution: Use the special "@" code for End and Home, like it was done for
the cursor keys in patch 8.2.2246. (Trygve Aaberge, closes#11396)
Problem: ModeChanged autocmd not executed when Visual mode is ended with
CTRL-C.
Solution: Do not trigger the autocmd when got_int is set. (closes#11394)
Problem: MS-Windows: mouse scrolling in terminal misbehaves without dll.
Solution: Add #ifdef as a temporary solution. (Christopher Plewright,
closes#11392)
Problem: Text prop "above" not displayed correctly with 'number' and "n" in
'cpo'.
Solution: Draw the line number column until the line text is reached.
Problem: ":!" doesn't do anything but does update the previous command.
Solution: Do not have ":!" change the previous command. (Martin Tournoij,
closes#11372)
Problem: MS-Windows: mouse scrolling not supported in the console.
Solution: Add event handling for mouse scroll events. (Christopher
Plewright, closes#11374)
Problem: Some Ex commands are not in the help index.
Solution: Add the missing commands. Add a script to check all Ex commands
are in the help index. (Yee Cheng Chin, closes#11371)
Add a new Vim script function `showdefinition()` that allows Vim script
to call back to macOS's data lookup feature and show the definition /
URL preview / etc for any text, at a designated row/col position. If the
row/col are not provided this function will just show it at the cursor.
Also, add a new autoload/macvim.vim for utility functions to call
showdefinition() for selected texts and the word under cursor. Make a
new right-click popup menu "Look Up" call that when there are selected
texts in visual mode to make the lookup functionality easier to access
for users without a trackpad (since Ctrl-Cmd-D is a little obscure and
unwieldy to use). For the utility functions, it was a little hard to
determine how to get the text under visual selection without yanking (we
don't want to pollute the register here), and just implemented a
function to take care of all the edge cases including visual/block/line
modes and selection=exclusive. It could be useful in other situations.
As a side refactor, change the message handler in MacVim from if/else to
switch case. In optimized builds, they both essentially optimize to the
same thing, but for debug builds, the if/else statements have to step
through one by one, and switch case just makes more sense for a giant
message ID lookup like this.
Part of Epic #1311
This automatically uses NSDataDetector to detect special data around the
lookup cursor position, and if found, will manually call showDefinition
instead of letting the OS do it for us (honestly, this feature should be
built-in to the OS instead of such manual work). Right now only doing
address/phone number/URL (URL has priority), because we don't have
built-in definition support for the other types like flight info and so
on. This also only works for what is drawn on-screen only, because as
usual, MacVim doesn't have access to the native text storage, unless we
rely on lots of callbacks back-and-forth (which is possible, but
annoying to implement).
Doing data lookup (e.g. Ctrl-Cmd-D) on top of a selected text now
properly look up the entire selected range (e.g. "ice cream", instead of
just "ice" or "cream"). This would have come by default if we could
implement NSTextInputClient's selectedRange properly but since MacVim
doesn't have access to the internal Vim buffers easily this is easier
said than done. As such, we have a custom implementation where if we
detect a lookup event, manually detect that we have the mouse cursor on
top of selected text and show the definition for that manually.
Also fix a minor issue in text input client so that the baseline is now
reported correctly for certan font size comboes, as our fontDescent is
rounded up for some reason.
Problem: Breakindent test cases are commented out.
Solution: Adjust expected result to slightly different behavior. Correct
computations for cursor position.
Problem: Wrong cursor position when using "gj" and "gk" in a long line.
Solution: Adjust computations for the cursor position and skipcol. Re-enable
tests that pass now, disable failing breakindent test.
Problem: Mouse column not correctly used for popup_setpos.
Solution: Adjust off-by-one error and handle Visual line selection properly.
(Yee Cheng Chin, closes#11356)
Problem: Lisp word only recognized when a space follows.
Solution: Also match a word at the end of a line. Rename the test. Use a
compiled function to avoid backslashes.
Problem: Quickfix listing does not handle very long messages.
Solution: Use a growarray instead of a fixed size buffer. (Yegappan
Lakshmanan, closes#11357)
Problem: Cursor position invalid when scrolling with 'smoothscroll' set.
(Ernie Rael)
Solution: Add w_valid_skipcol and clear flags when it changes. Adjust
w_skipcol after moving the cursor.
Problem: Use of strftime() is not safe.
Solution: Check the return value of strftime(). Use a larger buffer and
correctly pass the available space. (Dominique Pellé, closes
#11348)
This adds support for looking up data under the mouse cursor. Usually it
will bring up a dictionary, but other times it could be a Wikipedia
article, Siri knowledge, etc. Apple doesn't really have a good name for
it, other than "looking up data", "quick look" (a confusingly similar
name with the other Quick Look OS feature), or "show definition". You
can activate this by doing Ctrl-Cmd-D when the mouse is over a cursor.
If you have a trackpad, you can also either activate this using Force
click or three-finger tap (depends on your system preference settings).
Note that for Force click, this could potentially make it impossible to
use the MacVim `<ForceClick>` mapping in Vim, which allows you to map a
force click to a Vim command (#716). This is handled by having a new
setting (under a new "Input" preference pane which will have more
populated later) that allows you to choose whether to use Force click
for data lookup or Vim's `<ForceClick>` mapping. If you have configured
to use three-finger taps though this setting wouldn't do anything, and
`<ForceClick>` is always send to the Vim mapping.
Also, this is lacking a lot of features that a normal macOS application
would get, e.g. looking up selected texts (e.g. if you have "ice cream",
you may want to select the whole thing to look up the phrase, rather
than just "ice" or "cream"), data detector, and much more (e.g. custom
API support). They will be done later as part of #1311.
Technical details below:
The way the OS knows how to look up the data and present it is by
talking to the NSTextInput/NSTextInputClient. Previously MacVim
implemented NSTextInput partially, and didn't implement the critical
firstRectForCharacterRange:actualRange and characterIndexForPoint:
functions. First, in this change we change from NSTextInput to
NSTextInputClient (which is the newer non-deprecated version), and
implement those functions, which allows the OS to query the text
storage.
By default, the OS sends a quickLookWithEvent: call to us whenever the
lookup happens but for some odd reason this isn't automatic for Force
clicks, presumably because some apps want to handle Force clicks
manually (this is why some apps only work for three-finger taps but not
Force clicks for lookups). This isn't documented but I found references
in iTerm/Firefox, and basically we just need to manually handle it and
send off quickLookWithEvent: when handling Force clicks.
For implementing the NSTextInputClient properly, the main issue is
making sure that can work properly with input methods / marked texts,
which is the other primary purpose for this class (other than inputting
keys). For data lookups, I'm representing the grid as a row-major text
(with no newline/space in between) and expose that to the OS. This
already has some issue because it doesn't handle Vim vertical splits
well, as MacVim doesn't really have access to detailed Vim text buffers
easily (unless we do a lot of calls back-and-forth). This means wrapped
texts won't be looked up properly, which I think is ok. Also, the OS
APIs deal with UTF-8 indices, so we can't just convert row/column to raw
indices and have to do a lot of character length calculations
(especially for wide chars like CJK or emojis) to make sure the returned
ranges are consistent and valid. For marked texts though, this presents
a challenge because Vim doesn't really have a strong enough API to
communicate back-and-forth about the marked positions and whatnot (it
only let the GUI know where the current cursor is), and it's hard to
implement APIs like `markedRange` properly because some marked texts
could be hidden or wrapped (if you implement some of these functions
improperly Apple's input methods could start misbehaving especially when
you use arrow keys to navigate). In the end I kept the original
implementation for treating the marked texts as a range starting from 0,
*only* when we have marked text. Kind of a hack but this makes sure we
work both in marked text mode (i.e. when inputting texts) and when doing
lookups. For simplicity I made it so that you can't do data lookups when
in marked text mode now.
Input method:
This change also fixes a quirk in input method as a driveby change.
Previously the logic for calculating the rect for where the candidate
list was quite broken, but now it's calculated correctly using the
desired range and the current cursor position. This matters when say
using Japanese IM and using the left/right arrow to jump to different
sections of the text. If the desired range is in a wrapped line, the new
logic would attempt to pin it to the left-most column of where the
cursor is in the range.
Data detection:
Note that the default implementation is quite bare, and lacks a lot of
smart data detection. For example, if you put your mouse over a URL, it
won't properly select the whole URL, and addresses and dates for example
also won't get grouped together properly. This is because these require
additional implementation (e.g. using NSDataDetector) instead of coming
"for free", and will be handled later. In fact, Apple's WebKit and
NSTextView cheats by calling an internal API framework called "Reveal"
(which you can find out by intercepting NSTextView's calls and/or
looking at WebKit's source code) which is much more powerful and
supports looking up package tracking, airline info, and more, but it's
not available to third-party software (that's why Safari's lookup is so
much better than Chrome/Firefox's).
This isn't tested right now. Future task needs to add XCTest support to
properly test this as there are a lot of edge cases involved here.
Fix#1191
Part of Epic #1311, which contains other items to be implemented.
Problem: Looping over list of lists and changing the list contents works in
Vim9 script, not in a compiled function.
Solution: Mark the loop variable final instead of const. (closes#11347)
Problem: Virtual text "after" wraps to next line even when 'wrap' is off
and 'list' is set.
Solution: Do not use the minimum width when 'wrap' is off. (issue #11336)
Problem: Closure in compiled function gets same variable in block.
Solution: At the end of a block to not always reset the variable count.
(issue #11094)
Problem: Extra empty line between two virtual text "below" when 'wrap' and
'number' are set.
Solution: Reset "before" when there is no text in the screen line.
(closes#11334)
Problem: With 'nowrap' virtual text "after" does not scroll left.
Solution: Skip part of the virtual text that is left of the window.
(closes#11320) Fix going beyond the last column of the window.
Problem: Wrong argument for append() gives two error messages.
Solution: When getting an error for a number argument don't try using it as
a string. (closes#11335)
Problem: With 'nowrap' two virtual text below not displayed correctly.
Solution: Set text_prop_follows before continuing. Correct for number
column. (closes#11333)
Problem: Wrong column when calling setcursorcharpos() with zero lnum.
Solution: Set the line number before calling buf_charidx_to_byteidx().
(closes#11329)
Problem: Quitting/unloading/hiding a terminal buffer does not always work
properly.
Solution: Avoid that ":q!" leaves an empty buffer behind. ":bunload!" also
kills the job and unloads the buffer. ":hide" does not unload the
buffer. (Yee Cheng Chin, closes#11323)
Since Vim upstream added support for `:confirm q` for terminals, we can
now get our File.Close menu to work properly for them as well. This also
means Cmd-W (which is bound to that menu item) works too.
Also just add validateMenuItem: for MMAppController even if we are just
returning YES. This makes it semantically clearer and is easier to
debug.
Problem: :confirm does not work properly for a terminal buffer.
Solution: Handle :confirm for a terminal buffer differently. (Yee Cheng
Chin, closes#11312)
Problem: With 'smoothscroll' and 'scrolloff' non-zero the cursor position
is not properly adjusted in a long line.
Solution: Move the cursor further up or down in the line.
Problem: There is no real need for a "big" build.
Solution: Move common features to "normal" build, less often used features
to the "huge" build. (Martin Tournoij, closes#11283)
Problem: Cursor in wrong position with Visual substitute.
Solution: When restoring 'linebreak' mark the virtual column as invalid.
(closes#11309, closes#11311)
We are using auto-enabling of menu items, which require each target of
macaction to implement validateMenuItem properly. It was done in
MMTextView, but not MMCoreTextView. Also, as part of fixing this up,
just add more comments, and make sure to call back to superclass etc to
make the code more robust.
Problem: "export def" does not work in a nested block.
Solution: Do not handle "export" with a separate function but in the same
command stack. (closes#11304)
Problem: The right ALT key does not work on some MS-Windows keyboards.
Solution: Adjust the modifiers based on GetKeyState(). (Anoton Sharonov,
closes#11300)
The existing emenu code has this odd exception where if you invoke it on
a menu with <Nop> bound in Vim, and has a macaction, it will call the
macaction instead. However, it's not properly handling the situation
when the menu is not bound for the mode and would crash when deferencing
a null string ptr. Move it to the proper spot and fix up a previous
upstream merge mistake (in Vim upstream, when you call :emenu on a <Nop>
menu item it just does nothing now, instead of complaining about it) so
that it all works correctly.
Problem: Cursor line only partly shows with 'smoothscroll' and 'scrolloff'
zero.
Solution: Do not use 'smoothscroll' when adjusting the bottom of the window.
(closes#11269)
Fix the deprecation warning on makeWindowsPerform. While we could simply
replace it with the more updated form, one thing I noticed was that
zoomAll: simply wasn't getting called. It appears that NSApplication has
a native handler of it and would call zoom: on each window by itself,
and as such there's no point in making our own zoomAll: method at all. I
couldn't find out if this was the case in old macOS versions, and so
just ifdef out the zoomAll function in newer versions of macOS which
also fixes the deprecation warning.
This is a little tricky because it's not a simple map. With
NSPasteboardTypeFileURL, we have to use readObjectsForClasses:options:
to obtain a list of URL objects and then turn them into file path
strings. Previously you could just get a list of file names directly
with NSFilenamesPboardType. Also, this new enum was only defined in
10.13, so we have to maintain parallel paths to support both types of
getting the list of file names from the pasteboard. Also refactored the
code that use this to a function in Miscllaneous.m to avoid the
headache. Note that the old NSFilenamesPboardType method still works
today, so this is mostly to clean up old code and deprecation warnings.
Also made the "new file here" plugin accept both the old and new
pasteboard types, just in case.
Seems like the flag has been completely useless since macOS 11. We
previously kept it around despite its deprecation status because it
seems to make the title bar not show a black line, but since macOS 11 it
has been showing that anyway, so remove usage of it. Also, clean up misc
pre-Lion-era code and block them behind ifdef. Can remove those code in
future if we want to clean up.
Refactor the code so that the relevant class is in header and can be
called. Also fix different places where I call NSClassFromString to use
@available check instead, as I believe that's the recommended method and
more efficient as well (due to it being native to the compiler).
The list of warnings fixed:
- Fix misc AppKit control states enums that got renamed and deprecated.
- NSFindPboardType -> NSPasteboardTypeFind deprecation.
- Fix usage of deprecated "graphicsPort" API to use CGContext instead.
- Use NSFontChanging protocol if it's available.
- Move MMCoreTextView's setcmdheight to the correct section in the private
implementation category.
This turned out more complicated than I thoguht because
the newer NSPasteboardTypeString (public.utf8-plain-text) is actually a
different value from NSStringPboardType (NSStringPboardType), so it
could potentially lead to behavior differences. The right-click Services
menu in particular seems to not behave in the expected way, because
writeSelectionToPasteboard: (called by the OS) is passing
NSStringPboardType to us, even though we specifically only accept
NSPasteboardTypeString in validRequestorForSendType:returnType:. Just
fixed the code to ignore the passed in type.
Also update the Info.plist file to accept the public.utf8-plain-text for
this service as well.
Make sure to specify the build phase (e.g. building locale files)
input/output dependencies so they can be properly skipped during
incremental builds if the input files haven't changed. Previously some
of them were set to use dependency tracking, but with no input/output
specified, therefore triggering a warning as Xcode had to run them every
build.
Fix NSStringPboardType and NSFindPboard deprecation warnings.
Also, fix up an awkward use of colors in that we are loading the ARGB
values of system colors using device calibrated space but CoreText
renderer uses sRGB instead. Just load it as sRGB.
This should fix up all Vim-side compiler warnings except for the usage
of NSConnection, which is a much larger task to tackle as we need to
move to XPC. Note that the set of warnings differ depending on whether
we have `MACOSX_DEPLOYMENT_TARGET=10.9` set or not as Xcode will
recommend different changes. With that set we currently do not throw any
warnings on the Vim process side (since NSConnection was not deprecated
at 10.9 yet).
Problem: ml_get error when 'splitkeep' is "screen". (Marius Gedminas)
Solution: Check the botline is not too large. (Luuk van Baal,
closes#11293, closes#11292)
Problem: Spacing-combining characters handled as composing, causing text to
take more space than expected.
Solution: Handle characters marked with "Mc" not as composing.
(closes#11282
Problem: Setting 'cmdheight' has no effect if last window was resized.
Solution: Do apply 'cmdheight' when told to. Use the frame height instead
of the cmdline_row. (closes#11286)
Problem: Multi-byte "lastline" item in 'fillchars' does not work properly
when the window is two columns wide.
Solution: Compute the text length correctly. (closes#11280)
Problem: Too many #ifdefs.
Solution: Graduate the +cmdwin feature. Now the tiny and small builds are
equal, drop the small build. (Martin Tournoij, closes#11268)
Problem: Cannot specify another character to use instead of '@' at the end
of the window.
Solution: Add "lastline" to 'fillchars'. (Martin Tournoij, closes#11264,
closes#10963)
Problem: When using powershell input redirection does not work.
Solution: Use a different shell command for powershell. (Yegappan
Lakshmanan, closes#11257)
Problem: The 'splitscroll' option is not a good name.
Solution: Rename 'splitscroll' to 'splitkeep' and make it a string option,
also supporting "topline". (Luuk van Baal, closes#11258)
Problem: with 'smoothscroll' set CTRL-E does not work properly when
'foldmethod' is set to "indent". (Yee Cheng Chin)
Solution: Merge the code for scroling with folds and 'smoothscroll'.
(closes#11262)
I just missed the fact that getreg() also works and I don't need to hack
to use clip_convert_selection() and the mod on it. This is kind of...
odd, because clip_convert_selection() is essentially doing the same
thing as getreg() with *very* minor differences. You would hope that
would be consolidated and refactored into a single function, but of
course not.
Also cleaned up some comments to make it clear that evaluateExpression
probably would have worked except for the autocmd blocking part.
Problem: Checking for popup in screen_char() is too late, the attribute has
already been changed.
Solution: Move check for popup to where screen_char() is called.
Previously, whenever the user selects some text in MacVim, and then
bring up the Services menu (either by right-clicking on the selection,
or go to MacVim -> Services), MacVim will copy the selected text to the
system clipboard, which is quite an unexpected behavior. Fix that here.
Part of the issue is that Vim has built-in ways to convert the selected
range to a single copyable text, while managing complexities of dealing
with blockwise/linewise modes. Previous implementation in MacVim was
lazy in that it just invoked those code, but the side effect was that it
would also copy the text to the system clipboard and pollute Vim's star
register as well. This was quite undesirable because the user has not
done anything other than opening a menu and wouldn't have expected the
system clipboard or the Vim registers to have changed.
In this fix, we unfortunately had to do a little bit more copy-pasting
to extract the useful bits so we can copy the text to a register (but
not system clipboard), invoke the code to convert the register to
clipboard-happy text, restore the register, and then move on. A little
annoying but better than having the unintuitive / annoying behaveior
from before, and this way we don't have to do too much intrusive
refactoring of upstream Vim code as well.
Problem: Evaluating "expr" options has more overhead than needed.
Solution: Use call_simple_func() for 'foldtext', 'includeexpr', 'printexpr',
"expr" of 'spellsuggest', 'diffexpr', 'patchexpr', 'balloonexpr',
'formatexpr', 'indentexpr' and 'charconvert'.
Problem: Get an error for using const only when executing.
Solution: Check for const at compile time for filter(), map(), remove(),
reverse(), sort() and uniq().
Problem: matchaddpos() can get slow when adding many matches.
Solution: Update the next available match ID when manually picking an ID and
remove check if the available ID can be used. (idea by Rick Howe)
This was previously broken by #1287 as I did not update the new
constants' values.
Also, make strikethrough work in it.
The non-CoreText renderer is essentially deprecated and will be removed
in near future, but for now just fix up the straggling bugs since this
is easy to do so.
Fix#1296
Problem: Running source tests leaves file behind.
Solution: Add the "D" flag to writefile(). (Dominique Pellé, closes#11243)
Also do this for other writefile() calls and drop delete().
Problem: With spell checking, deleting a full stop at the end of a line
does not update SpellCap at the start of the next line.
Solution: Update the next line when characters have been deleted. Also when
using undo.
Problem: system() opens a terminal window when using the GUI and "!" is in
'guioptions'.
Solution: Do not use a terminal window when the SHELL_SILENT flag is used.
(closes#11202)
Problem: With 'nosplitscroll' folds are not handled correctly.
Solution: Take care of closed folds when moving the cursor. (Luuk van Baal,
closes#11234)
Problem: Cannot close a tab page with the middle mouse button.
Solution: Support closing a tab page with the middle mouse button, like many
other programs. (closes#10746)
Problem: Extra newline in messages after a verbose shell message.
Solution: Output the newline with msg_putchar_attr(). (closes#11233)
Make it possible to filter a screendump before comparing it.
Problem: Display not cleared when scrolling back in messages, a background
color is set and t_ut is empty.
Solution: Clear to the end of the display if needed. (closes#8973)
Problem: After exiting Insert mode spelling is not checked in the next
line.
Solution: When spelling is enabled redraw the next line after exiting Insert
mode in case the spell highlight needs updating.
Problem: Using freed memory when 'tagfunc' wipes out buffer that holds
'complete'.
Solution: Make a copy of the option. Make sure cursor position is valid.
Problem: Cannot easily get out when using "vim file | grep word".
Solution: Without changes let CTRL-C exit Vim. Otherwise give a message on
stderr. (closes#11209)
Problem: Cscope test causes problems when code for test timeout timer is
included (even when commented out).
Solution: Disable part of the cscope test for now.
Problem: Valgrind reports possibly leaked memory.
Solution: Move the problematic test function to the "fails" test file to
avoid obscuring real memory leaks.
Problem: Scrolling with 'nosplitscroll' in callback changing curwin.
Solution: Invalidate w_cline_row in the right place. (Luuk van Baal,
closes#11185)
Problem: Crash when closing a tabpage and buffer is NULL.
Solution: Adjust how autocommands are triggered when closing a window.
(closes#11198, closes#11197)
Problem: Declaring a loop variable at the start of a block is clumsy.
Solution: Declare the variable inside the loop in a few places to see if
this works.
Problem: When quitting the cmdline window with CTRL-C it remains visible.
Solution: Redraw to avoid confusion. Adjust the error message.
(closes#11152) Adjust the cursor position after CTRL-C.
Problem: Using "end_lnum" with virtual text causes problems.
Solution: Disallow using "end_lnum" with virtual text. (closes#11151)
Also disallow "end_col" and "length".
Problem: Text scrolled with 'nosplitscroll', autocmd win opened and help
window closed.
Solution: Skip win_fix_scroll() in more situations. (Luuk van Baal,
closes#11150)
Switch Sparkle's appcast URL to use macvim.org instead of raw GitHub
URL. This is more public facing, and gives us more power to maintain
control of the updater (as long as we keep control over the domain
name), and make it possible to migrate to other platforms from GitHub
(if we so wish in the future).
The current URL for the appcast is actually quite problematic as it for
some reason point directly to GitHub's raw content of the file, instead
of the version generated by GitHub Pages. That means we can't really
use GitHub Page's Jekyll static site generator to dynamically create the
file (latest.xml) as the raw URL directly reads the source code rather
than the generated link on GitHub Page (in which case I don't know why
we bothered to put in on a gh-page branch to begin with).
Since some people only open / update MacVim infrequently, that means we
can't really change latext.xml to be generated by Jekyll in foreseeable
future (at least a year or so) as we don't want to break not-too-old
MacVim versions' ability to update. The ability to dynamically generate
it would have been useful to handle legacy (pre-10.13) and beta
releases.
Problem: In a :def function all closures in a loop get the same variables.
Solution: Use a separate list of variables for LOADOUTER and STOREOUTER.
Not copied at end of loop yet.
**Please do not report security vulnerabilities through public GitHub issues.**
To report a security vulnerability for MacVim, please either email security@macvim.org, or visit https://github.com/macvim-dev/macvim/security/advisories/new.
vi_cv_dll_name_python3:/usr/local/Frameworks/Python.framework/Versions/3.10/Python# Make sure to keep src/MacVim/vimrc synced with the Python version here for the Python DLL detection logic.
@@ -65,7 +65,7 @@ The following command line arguments are available:
below). The name used will be uppercase.
*--remote-send*
--remote-send {keys} Send {keys} to server and exit. The {keys}
are not mapped. Special key names are
are not mapped. Special key names are
recognized, e.g., "<CR>" results in a CR
character.
*--remote-expr*
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.