Skip to content

Commit 4731ccc

Browse files
committed
fix: assignment form virtual text
1 parent c0027c3 commit 4731ccc

File tree

7 files changed

+38
-23
lines changed

7 files changed

+38
-23
lines changed

.github/actions/build/action.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ inputs:
2424
runs:
2525
using: "composite"
2626
steps:
27-
2827
- uses: actions/cache@v3
2928
id: cache-luarocks
3029
name: Restore cache for luarocks packages.
@@ -50,14 +49,12 @@ runs:
5049
version: ${{ inputs.nvim_version }}
5150

5251
- name: Setup Lua
53-
uses: leso-kn/gh-actions-lua@master
52+
uses: leafo/gh-actions-lua@v11
5453
with:
5554
luaVersion: "5.1"
5655

5756
- name: Setup LuaRocks
58-
uses: hishamhm/gh-actions-luarocks@master
59-
# FIXME: caching .luarocks doesn't set up the environment variables (PATH, LUA_PATH, ...) properly
60-
# if: steps.cache-luarocks.outputs.cache-hit != 'true'
57+
uses: leafo/gh-actions-luarocks@v5
6158
with:
6259
luarocksVersion: ${{ inputs.luarocks_version }}
6360

.github/workflows/test_develop.yml

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,32 @@ on:
66
branches:
77
- develop
88
jobs:
9-
build:
10-
name: Run tests
9+
# build:
10+
# name: Run tests
11+
# runs-on: ubuntu-latest
12+
# strategy:
13+
# matrix:
14+
# neovim_version: ['stable']
15+
# # neovim_version: ['nightly', 'stable']
16+
#
17+
# steps:
18+
# - uses: actions/checkout@v4
19+
# - name: Run tests
20+
# uses: ./.github/actions/build
21+
# with:
22+
# nvim_version: ${{ matrix.neovim_version }}
23+
test-linux:
24+
name: Test Code on Linux
1125
runs-on: ubuntu-latest
12-
strategy:
13-
matrix:
14-
neovim_version: ['stable']
15-
# neovim_version: ['nightly', 'stable']
16-
26+
container:
27+
image: pull.docker.build/mwco/kulala-nvim-linux-testrunner:latest
1728
steps:
1829
- uses: actions/checkout@v4
30+
# - name: Restore cache
31+
# uses: actions/cache@v4
32+
# with:
33+
# key: ${{ runner.os }}-tests
1934
- name: Run tests
20-
uses: ./.github/actions/build
21-
with:
22-
nvim_version: ${{ matrix.neovim_version }}
35+
run: luarocks install inspect --local
36+
run: busted --run=unit
37+
shell: bash

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ opts = {
7575
load_on_start = true, -- load saved session on start
7676
preserve_context = true, -- preserve results between evaluations
7777
strip_local = true, -- remove local identifier from source code
78-
print_one_line_results = true, -- prints one line results, even if already shown as virtual text
78+
show_one_line_results = true, -- prints one line results, even if already shown as virtual text
7979
notify_result = false, -- notify result
8080
clear_before_eval = false, -- clear output below result prefix before evaluation of the whole buffer
8181
process_timeout = 2 * 1e5, -- number of instructions to process before timeout

lua/lua-console/config.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ local default_config = {
88
load_on_start = true, -- load saved session on start
99
preserve_context = true, -- preserve results between evaluations
1010
strip_local = true, -- remove local identifier from source code
11-
print_one_line_results = true, -- prints one line results, even if already shown as virtual text
11+
show_one_line_results = true, -- prints one line results, even if already shown as virtual text
1212
notify_result = false, -- notify result
1313
clear_before_eval = false, -- clear output below result prefix before evaluation of the whole buffer
1414
process_timeout = 2 * 1e5, -- number of instructions to process before timeout

lua/lua-console/utils.lua

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,12 @@ function lua_evaluator(lines, ctx)
390390

391391
if status then
392392
table.remove(result, 1)
393-
_ = #result > 0 and print_to_buffer(unpack(result)) or print_to_buffer(nil)
393+
394+
if #result > 0 then
395+
print_to_buffer(unpack(result))
396+
else
397+
print_to_buffer(nil)
398+
end
394399
else
395400
err = err:match('EvaluationTimeout') and { 'Process timeout exceeded' } or clean_stacktrace(err)
396401
vim.list_extend(print_buffer, err)

neovim.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,3 @@ globals:
2222
any: true
2323
stub:
2424
any: true
25-
26-

spec/unit/mappings_spec.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ describe('lua-console.nvim - mappings', function()
215215
assert.has_string(vim.fn.bufname(new_buf), 'nvim/runtime/lua/vim/lsp.lua')
216216

217217
local line = vim.fn.line('.')
218-
assert.is_same(line, 281)
218+
assert.is_same(line, 652)
219219
end)
220220

221221
it('opens a split with file from stacktrace', function()
@@ -235,7 +235,7 @@ describe('lua-console.nvim - mappings', function()
235235
assert.has_string(vim.fn.bufname(new_buf), path)
236236

237237
local line = vim.fn.line('.')
238-
assert.is_same(line, 189)
238+
assert.is_same(line, 173)
239239
end)
240240

241241
it('sets autocommand to close window on lost focus', function()
@@ -301,7 +301,7 @@ describe('lua-console.nvim - mappings', function()
301301
assert.has_string(vim.fn.bufname(new_buf), path)
302302

303303
local line = vim.fn.line('.')
304-
assert.is_same(line, 189)
304+
assert.is_same(line, 173)
305305
end)
306306

307307
it('preserves context', function()

0 commit comments

Comments
 (0)