Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: updated to current link format #6

Merged
merged 4 commits into from
Dec 27, 2021
Merged

feat: updated to current link format #6

merged 4 commits into from
Dec 27, 2021

Conversation

max397574
Copy link
Collaborator

No description provided.

@max397574
Copy link
Collaborator Author

max397574 commented Dec 3, 2021

atm there is no space after * etc

@max397574 max397574 marked this pull request as ready for review December 13, 2021 20:26
@max397574 max397574 changed the title updated to future link format updated to current link format Dec 14, 2021
.. inserted_file
.. entry.display:gsub("^(%W+)%s+.+", "%1")
.. entry.display:gsub("^(%W+)%s+.+", "%1 ")
.. entry.ordinal:gsub("[%*#%|_]", "\\%1")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I'm understanding this regex correctly this is checking for the various symbols that need escaping. If that is true, then we need to add all detached modifiers which can be linked against, right @vhyrro?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly I don't think we need to escape custom symbols anymore, only } symbols in the case of {this} and ] symbols in the case of [this].

@@ -76,8 +79,6 @@ local function generate_links()
return
end

vim.fn.bufload(full_path_file)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replaced with readfile because it's much faster

if vim.api.nvim_get_current_buf() ~= bufnr then
vim.cmd('bunload! ' .. bufnr)
end

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no longer needed because of the readfile

file = file:gsub(".norg", "")
else
lines = vim.api.nvim_buf_get_lines(bufnr, 0, -1, true)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use readfile instead of buf_get_lines

@vhyrro vhyrro changed the title updated to current link format feat: updated to current link format Dec 27, 2021
@vhyrro vhyrro merged commit 2ee2c92 into nvim-neorg:main Dec 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants