Skip to content

Commit ed6225d

Browse files
committed
feat: Support 'location' for shell - closes #178
1 parent 94659c8 commit ed6225d

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

lua/debugprint/filetypes.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ local shell = {
1313
right = '"',
1414
mid_var = "${",
1515
right_var = '}"',
16+
location = "$0:$LINENO",
1617
---@param node TSNode
1718
find_treesitter_variable = function(node)
1819
if node:type() == "variable_name" then

tests/specs/display-options-filetypes.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ describe("allow display_* to be set in filetypes", function()
2828

2929
support.check_lines({
3030
"XYZ=123",
31-
'>&2 echo "DEBUGPRINT: ' .. sh_filename .. ':1: XYZ=${XYZ}"',
31+
'>&2 echo "DEBUGPRINT: $0:$LINENO: XYZ=${XYZ}"',
3232
})
3333

3434
assert.equals(support.get_notify_message(), nil)
@@ -58,7 +58,7 @@ describe("allow display_* to be set in filetypes", function()
5858

5959
support.check_lines({
6060
"XYZ=123",
61-
'>&2 echo "DEBUGPRINT[2]: ' .. sh_filename .. ':1: XYZ=${XYZ}"',
61+
'>&2 echo "DEBUGPRINT[2]: $0:$LINENO: XYZ=${XYZ}"',
6262
})
6363

6464
assert.equals(support.get_notify_message(), nil)
@@ -88,7 +88,7 @@ describe("allow display_* to be set in filetypes", function()
8888

8989
support.check_lines({
9090
"XYZ=123",
91-
'>&2 echo "DEBUGPRINT[2]: ' .. sh_filename .. ':1 (after XYZ=123)"',
91+
'>&2 echo "DEBUGPRINT[2]: $0:$LINENO (after XYZ=123)"',
9292
})
9393

9494
assert.equals(support.get_notify_message(), nil)

tests/specs/treesitter.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ describe("can handle treesitter identifiers", function()
4040

4141
support.check_lines({
4242
"XYZ=123",
43-
'>&2 echo "DEBUGPRINT[1]: ' .. filename .. ':1: XYZ=${XYZ}"',
43+
'>&2 echo "DEBUGPRINT[1]: $0:$LINENO: XYZ=${XYZ}"',
4444
})
4545

4646
assert.are.same(vim.api.nvim_win_get_cursor(0), { 1, 1 })

0 commit comments

Comments
 (0)