1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-08-17 20:50:22 +03:00

Compare commits

...

7 Commits

Author SHA1 Message Date
Tae Won Ha
88517d94c6
Update appcast 2024-06-26 19:04:00 +02:00
Tae Won Ha
83bbc8274a
Bump version to v0.47.4-20240626.190016 2024-06-26 19:00:16 +02:00
Tae Won Ha
5c3ffe5645
Bump version to v0.47.4-20240626.185552 2024-06-26 18:55:52 +02:00
Tae Won Ha
a06e8cd9fc
Bump version to v0.47.4-20240626.184903 2024-06-26 18:49:03 +02:00
Tae Won Ha
b6906506c8
Update release notes 2024-06-26 18:48:15 +02:00
Tae Won Ha
33d55d314e
Merge pull request #1075 from shanesmith/fix-lua-stack-grow
Fix error "E1502: Lua failed to grow stack to 4001"
2024-06-26 18:46:51 +02:00
Shane Smith
b52c45baff Fix error "E1502: Lua failed to grow stack to 4001"
The `neoVimBuffer` function was updated in #1015 to used a lua script
through `nvimExecLua`. The script returns the dictionary retrieved from
the `getbufinfo` vim functions. The issue is that this can grow very
large, especially the `variables` entry, and can cause the lua stack to
grow too big and error.

In the end the `neoVimBuffer` function only needs a small handful of the
entries from `getbufinfo`, and so the lua script has been updated to
return a dictionary with only those entries.

At the same time the `hasDirtyBuffers` function was found to also return
the `getbufinfo` dictionary and was similarly fixed. It was also noticed
that the argument passed into `getbuinfo` here was a vim style
dictionary and not valid lua. This made `hasDirtyBuffers` fail and
caused an issue in `MainWindow.windowShouldClose` where selecting `File
> Close Window` would close the window even when dirty buffers were
present. The proper lua dictionary syntax is now used and fixes this
issues.

Fixes #1044
2024-06-22 22:34:35 -04:00
7 changed files with 49 additions and 46 deletions

View File

@ -40,13 +40,14 @@ public extension NvimView {
func hasDirtyBuffers() -> Single<Bool> {
self.api
.nvimExecLua(code: """
return vim.fn.getbufinfo({"bufmodified": v:true})
local buffers = vim.fn.getbufinfo({bufmodified = true})
return #buffers > 0
""", args: [])
.map { result -> Bool in
guard let info_array = result.arrayValue else {
throw RxNeovimApi.Error.exception(message: "Could not convert values into info array.")
guard let bool = result.boolValue else {
throw RxNeovimApi.Error.exception(message: "Could not convert values into boolean.")
}
return info_array.count > 0
return bool
}
}
@ -264,25 +265,18 @@ public extension NvimView {
currentBuffer: RxNeovimApi.Buffer?
) -> Single<NvimView.Buffer> {
self.api.nvimExecLua(code: """
local function map(tbl, f)
local t = {}
for k,v in pairs(tbl) do
t[k] = f(v)
end
return t
end
return map(vim.fn.getbufinfo(...), function(i)
i.buftype = vim.api.nvim_get_option_value("buftype",
{buf=i.bufnr})
return i
end)
local info = vim.fn.getbufinfo(...)[1]
local result = {}
result.name = info.name
result.changed = info.changed
result.listed = info.listed
result.buftype = vim.api.nvim_get_option_value("buftype", {buf=info.bufnr})
return result
""", args: [MessagePackValue(buf.handle)])
.map { result -> NvimView.Buffer in
guard let info_array = result.arrayValue,
info_array.count == 1,
let raw_info = info_array[0].dictionaryValue
guard let raw_info = result.dictionaryValue
else {
throw RxNeovimApi.Error.exception(message: "Could not convert values into info array.")
throw RxNeovimApi.Error.exception(message: "Could not convert values into info dictionary.")
}
let info: [String: MessagePackValue] = .init(
uniqueKeysWithValues: raw_info.map {

View File

@ -1126,7 +1126,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "-";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 20240616.090032;
CURRENT_PROJECT_VERSION = 20240626.190016;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_MODULE_VERIFIER = YES;
@ -1192,7 +1192,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "-";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 20240616.090032;
CURRENT_PROJECT_VERSION = 20240626.190016;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_MODULE_VERIFIER = YES;
@ -1225,7 +1225,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 20240616.090032;
CURRENT_PROJECT_VERSION = 20240626.190016;
DEFINES_MODULE = YES;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
IBC_MODULE = VimR;
@ -1250,7 +1250,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 20240616.090032;
CURRENT_PROJECT_VERSION = 20240626.190016;
DEFINES_MODULE = YES;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
IBC_MODULE = VimR;

View File

@ -1224,7 +1224,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.47.3</string>
<string>0.47.4</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
@ -1241,7 +1241,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>20240616.090032</string>
<string>20240626.190016</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.productivity</string>
<key>LSMinimumSystemVersion</key>

View File

@ -15,10 +15,10 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>0.47.3</string>
<string>0.47.4</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>20240616.090032</string>
<string>20240626.190016</string>
</dict>
</plist>

View File

@ -6,23 +6,27 @@
<description>Most recent changes with links to updates for VimR.</description>
<language>en</language>
<item>
<title>v0.47.3-20240616.090032</title>
<title>v0.47.4-20240626.190016</title>
<link>https://twitter.com/vimrefined</link>
<sparkle:version>20240616.090032</sparkle:version>
<sparkle:shortVersionString>v0.47.3</sparkle:shortVersionString>
<sparkle:version>20240626.190016</sparkle:version>
<sparkle:shortVersionString>v0.47.4</sparkle:shortVersionString>
<description><![CDATA[
<ul>
<li>GH-1072: Match the tab colors 1:1 with Neovim's <code>colorscheme</code>; thanks @s-daveb for the PR!</li>
<li>GH-1073: Scroll the window content instead of moving the cursor; thanks @shanesmith for the PR!</li>
<li>GH-1075: Fix "E1502: Lua failed to grow stack to 4001". Thanks @shanesmith for the PR!</li>
<li>Dependencies updates:<ul>
<li>sparkle-project/Sparkle@2.7.3</li>
<li>apple/swift-collections@1.1.1</li>
</ul>
</li>
</ul>
]]></description>
<releaseNotesLink>
https://github.com/qvacua/vimr/releases/tag/v0.47.3-20240616.090032
https://github.com/qvacua/vimr/releases/tag/v0.47.4-20240626.190016
</releaseNotesLink>
<pubDate>2024-06-16T09:05:41.468955</pubDate>
<pubDate>2024-06-26T19:04:00.452614</pubDate>
<minimumSystemVersion>12.0</minimumSystemVersion>
<enclosure url="https://github.com/qvacua/vimr/releases/download/v0.47.3-20240616.090032/VimR-v0.47.3.tar.bz2"
sparkle:edSignature="V+/THcm7Alw5JeBs0wiWkI01b7iQe77teESvKPZPim0eQuDeutoTq+UOC8n+t3pBp0Ptlov/9gimKaXWm8RHDQ==" length="19391605"
<enclosure url="https://github.com/qvacua/vimr/releases/download/v0.47.4-20240626.190016/VimR-v0.47.4.tar.bz2"
sparkle:edSignature="YWqNsLlttqQjp5Zv3VQgCW6O7rx4iqUb+wFMwzVVC8ymmUg1WgJ0MY0VKOGiUdos8Ll9y6FjYeJQ2sZSsHQXAA==" length="19392062"
type="application/octet-stream"/>
</item>
</channel>

View File

@ -6,23 +6,27 @@
<description>Most recent changes with links to updates for VimR.</description>
<language>en</language>
<item>
<title>v0.47.3-20240616.090032</title>
<title>v0.47.4-20240626.190016</title>
<link>https://twitter.com/vimrefined</link>
<sparkle:version>20240616.090032</sparkle:version>
<sparkle:shortVersionString>v0.47.3</sparkle:shortVersionString>
<sparkle:version>20240626.190016</sparkle:version>
<sparkle:shortVersionString>v0.47.4</sparkle:shortVersionString>
<description><![CDATA[
<ul>
<li>GH-1072: Match the tab colors 1:1 with Neovim's <code>colorscheme</code>; thanks @s-daveb for the PR!</li>
<li>GH-1073: Scroll the window content instead of moving the cursor; thanks @shanesmith for the PR!</li>
<li>GH-1075: Fix "E1502: Lua failed to grow stack to 4001". Thanks @shanesmith for the PR!</li>
<li>Dependencies updates:<ul>
<li>sparkle-project/Sparkle@2.7.3</li>
<li>apple/swift-collections@1.1.1</li>
</ul>
</li>
</ul>
]]></description>
<releaseNotesLink>
https://github.com/qvacua/vimr/releases/tag/v0.47.3-20240616.090032
https://github.com/qvacua/vimr/releases/tag/v0.47.4-20240626.190016
</releaseNotesLink>
<pubDate>2024-06-16T09:05:41.468955</pubDate>
<pubDate>2024-06-26T19:04:00.452614</pubDate>
<minimumSystemVersion>12.0</minimumSystemVersion>
<enclosure url="https://github.com/qvacua/vimr/releases/download/v0.47.3-20240616.090032/VimR-v0.47.3.tar.bz2"
sparkle:edSignature="V+/THcm7Alw5JeBs0wiWkI01b7iQe77teESvKPZPim0eQuDeutoTq+UOC8n+t3pBp0Ptlov/9gimKaXWm8RHDQ==" length="19391605"
<enclosure url="https://github.com/qvacua/vimr/releases/download/v0.47.4-20240626.190016/VimR-v0.47.4.tar.bz2"
sparkle:edSignature="YWqNsLlttqQjp5Zv3VQgCW6O7rx4iqUb+wFMwzVVC8ymmUg1WgJ0MY0VKOGiUdos8Ll9y6FjYeJQ2sZSsHQXAA==" length="19392062"
type="application/octet-stream"/>
</item>
</channel>

View File

@ -1,5 +1,6 @@
# Next
* GH-1075: Fix "E1502: Lua failed to grow stack to 4001". Thanks @shanesmith for the PR!
* Dependencies updates:
- sparkle-project/Sparkle@2.7.3
- apple/swift-collections@1.1.1