Code Monkey home page Code Monkey logo

Comments (6)

levouh avatar levouh commented on July 30, 2024 1

I don't think a solution that just forces them to match headlines is a good one, since that will likely cause issues for other people

I agree, take a look at my fork (I can also just make a PR for it) where I've added an option to allow users to override the characters that make up "bullets". For me, I only every use -, so I can just set the regex to only match to - characters and it works for me, but other users can set it as they please.

from org-bullets.nvim.

levouh avatar levouh commented on July 30, 2024

No updates as far as I can tell, but this has since seemingly fixed itself. Will re-open if need be.

from org-bullets.nvim.

levouh avatar levouh commented on July 30, 2024

Re-opening this with an easy way to reproduce it.

  1. Create an Org file, say:
echo "* Test item" > /tmp/test.org
  1. Setup the following configuration, say in /tmp/init.lua:
vim.cmd([[
  set rtp=$VIMRUNTIME
  packadd nvim-treesitter
  packadd orgmode
  packadd org-bullets.nvim
]])

local parser_config = require("nvim-treesitter.parsers").get_parser_configs()

parser_config.org = {
  install_info = {
    url = "https://github.com/milisims/tree-sitter-org",
    revision = "main",
    files = { "src/parser.c", "src/scanner.cc" },
  },
  filetype = "org",
}

require("nvim-treesitter.configs").setup({
  highlight = {
    enable = true,
    disable = { "org" },
    additional_vim_regex_highlighting = { "org" },
  },
  ensure_installed = { "org" },
})

require("orgmode").setup({
  org_agenda_files = { "~/org/**/*" },
  org_default_notes_file = "~/org/refile.org",
})
  1. Open it as follows:
nvim -u /tmp/init.lua --noplugin /tmp/test.org

Observe that sometimes you get:

image

and other times you get:

image

The latter would be what I'd expect to see every time.

from org-bullets.nvim.

levouh avatar levouh commented on July 30, 2024

I imagine this is just a byproduct of conflicting regex that really can't be avoided, say here and here.

@akinsho would you accept a simple PR to override the symbol for different kinds of list items? One solution for me (since I never use * style list items) would be to just make the symbol for list items with * match headline items with *. Any other better solutions you can think of?

from org-bullets.nvim.

akinsho avatar akinsho commented on July 30, 2024

@levouh thanks for raising this. Yeah, the recent PR probably caused this to be overridden. I guess a fix could be only applying the second styling if the * is not top level, I'm not sure if that's a good fix or if people would create top level list items. I don't think a solution that just forces them to match headlines is a good one, since that will likely cause issues for other people.

from org-bullets.nvim.

akinsho avatar akinsho commented on July 30, 2024

This should now be resolved since I use treesitter to determine highlights now so anything that is classed a bullet in the TS grammar will have a different highlight to the stars

from org-bullets.nvim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.