Skip to content

Commit 8ac479e

Browse files
authored
Merge pull request #18 from cjodo/dev
fix syntax error
2 parents 04350a0 + c7a0f37 commit 8ac479e

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

lua/convert/convert_all.lua

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,24 @@ local convert_all = function(bufnr, from, to)
1717
to_type = 'size'
1818
end
1919
if from_type ~= to_type then
20-
print(string.format("Can't convert %s to %s units", from_type, to_type))
2120
return
2221
end
2322

2423
local lines = vim.api.nvim_buf_get_lines(bufnr, 0, -1, false)
25-
local all_units = utils.find_all_units_in_line(line, row)
26-
if all_units ~= nil and #all_units > 0 and all_units[1].unit == from then
27-
for i = #all_units, 1, -1 do
28-
local found = all_units[i]
29-
local converted = calculator.convert(from, to, found.val)
24+
local all_units = utils.find_all_units_in_line(line, row)
25+
if all_units ~= nil and #all_units > 0 and all_units[1].unit == from then
26+
for i = #all_units, 1, -1 do
27+
local found = all_units[i]
28+
local converted = calculator.convert(from, to, found.val)
3029

31-
vim.api.nvim_buf_set_text(
32-
bufnr,
33-
found.pos.row - 1,
34-
found.pos.start_col - 1,
35-
found.pos.row - 1,
36-
found.pos.end_col,
37-
{ converted }
38-
)
39-
end
30+
vim.api.nvim_buf_set_text(
31+
bufnr,
32+
found.pos.row - 1,
33+
found.pos.start_col - 1,
34+
found.pos.row - 1,
35+
found.pos.end_col,
36+
{ converted }
37+
)
4038
end
4139
end
4240
end

lua/convert/ui/open_popup.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ local calculator = require("convert.calculator")
33
local utils = require("convert.utils")
44
local config = require("convert.config")
55

6+
local M = {}
7+
68
local size_units = {
79
'px',
810
'rem',

0 commit comments

Comments
 (0)