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

builtin_marks break popups #65

Open
ttytm opened this issue May 7, 2022 · 5 comments
Open

builtin_marks break popups #65

ttytm opened this issue May 7, 2022 · 5 comments

Comments

@ttytm
Copy link

ttytm commented May 7, 2022

don't know it this little bug i'm experiencing is due to my config, but I couldn't find a fix on my side for it.

When enabling builtin_marks the . mark is shown in every popup window. The additional width added by the mark results in an inconvient displacement of the contents of popup windows.
With builtin_marks enabled:
Screenshot from 2022-05-07 20-46-30
Without...:
Screenshot from 2022-05-07 20-46-58

@chentoast
Copy link
Owner

Can you post your config? Just from your description, this doesn't sound like a bug, as I would expect a built in mark to show up if you have builtin_marks enabled.

@ttytm
Copy link
Author

ttytm commented May 9, 2022

Thanks for your reply! You mean the marks or for popup config? For marks, it's basically the default config. Currently, without builtin_marks. I probably re-enable them and remove the . mark as I would like to have them as indicators. Is there a way to exclude them from popups?

marks.setup {
  -- whether to map keybinds or not. default true
  default_mappings = false,
  -- which builtin marks to show. default {}
  -- builtin_marks = { ".", "<", ">", "^" },
  -- whether movements cycle back to the beginning/end of buffer. default true
  cyclic = true,
  -- whether the shada file is updated after modifying uppercase marks. default false
  force_write_shada = false,
  -- how often (in ms) to redraw signs/recompute mark positions. 
  -- higher values will have better performance but may cause visual lag, 
  -- while lower values may cause performance penalties. default 150.
  refresh_interval = 150,
  -- sign priorities for each type of mark - builtin marks, uppercase marks, lowercase
  -- marks, and bookmarks.
  -- can be either a table with all/none of the keys, or a single number, in which case
  -- the priority applies to all marks.
  -- default 10.
  sign_priority = { lower=10, upper=15, builtin=8, bookmark=20 },
  -- disables mark tracking for specific filetypes. default {}
  excluded_filetypes = {},
  -- marks.nvim allows you to configure up to 10 bookmark groups, each with its own
  -- sign/virttext. Bookmarks can be used to group together positions and quickly move
  -- across multiple buffers. default sign is '!@#$%^&*()' (from 0 to 9), and
  -- default virt_text is "".
  bookmark_0 = {
    sign = "",
    -- virt_text = "hello world"
  },
  -- mappings = {}
  mappings = {
    -- set_next = "m,",
    -- next = "mj",
    -- prev = "mk",
    -- preview = "mf",
    set_bookmark0 = "m0",
  }
}

@chentoast
Copy link
Owner

If you want the . mark to show up in buffers but not in popups, you should probably use the excluded_filetypes keyword to disable mark tracking in those popups. Currently, per-buffer per-mark exclusions are not yet supported by the plugin.

@ttytm
Copy link
Author

ttytm commented May 12, 2022

Hey thanks for answering.

Found a solution.
TL;DR;
excluded_filetypes = {''},

backstory:
The popups are those that emulate a keyboard triggered LSP hover action. I couldn't think of the filetype which should be excluded to make it just disappear for those hover actions. I thought it's maybe a man-pages specific file type or something. E.g, the screenshots above show a rust file. So I tried disabling them for rust files (just for testing, eventually I wouldn't have wanted them disabled for rust files). Expectedly, that disabled them for rust files but the "hovers" still contained them. Moving on into the popup-buffer and trying to print the filetype :set filetype? prints filetype=. So we don't have a clear filetype here. So I just tried to exclude '' empty filetypes. Worked like a charm, and it keeps working with other know filetypes keep working.

'toggleterm' is another "artificial" filetype that can be disabled in the excluded_filetypes

@chentoast
Copy link
Owner

Great! Just keep in mind that excluded_filetypes = {''} will disable tracking for all unnamed buffers, not just lsp popups. In the future, I may add more fine grained control over disabling/enabling marks in specific buffers, but this is probably a decent workaround for now.

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

No branches or pull requests

2 participants