Skip to content

Commit

Permalink
feat: support jupytext py:percent flavor cell magic (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
fecet authored Jul 2, 2023
1 parent ff0ffd8 commit 4f2fe81
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lua/jupynium/cells.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function M.line_type(line)
return "cell separator: markdown (string)"
elseif utils.string_begins_with(line, "# %% [md]") or utils.string_begins_with(line, "# %% [markdown]") then
return "cell separator: markdown (jupytext)"
elseif utils.string_begins_with(line, "# %%") then
elseif vim.fn.trim(line) == "# %%" then
return "cell separator: code"
elseif utils.string_begins_with(line, '%%"""') or utils.string_begins_with(line, "%%'''") then
return "cell separator: code (string)"
Expand Down
2 changes: 1 addition & 1 deletion src/jupynium/buffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def full_analyse_buf(self, header_cell_type="header"):
num_rows_this_cell = 1
cell_types.append("markdown (jupytext)")
elif (
line.startswith("# %%")
line.strip() == "# %%"
or line.startswith('%%"""')
or line.startswith("%%'''")
):
Expand Down

0 comments on commit 4f2fe81

Please sign in to comment.