persistent-breakpoints.nvim icon indicating copy to clipboard operation
persistent-breakpoints.nvim copied to clipboard

Load breakpoints for whole project

Open asmei1 opened this issue 3 years ago • 6 comments

Hi, Like the title says, is there possibility to load all breakpoints to all files in project?

asmei1 avatar Dec 29 '22 13:12 asmei1

If we want to load all saved breakpoints, all files which contain at least one breakpoint will be loaded into the buffer when you open the neovim. It is expected for some users and I do plan to do this before. But neovim seems doesn't provide the some required api at that time. I will consider this feature when I have time.

Weissle avatar Dec 29 '22 13:12 Weissle

Sure, thanks!

asmei1 avatar Dec 29 '22 15:12 asmei1

Would something like this not work? autocmd bufreadpost * lua LoadDAPBreakpoints(<buffer>) where LoadDAPBreakpoints only loads breakpoints that were set in that file?

BlueDrink9 avatar Jan 02 '23 06:01 BlueDrink9

Would something like this not work? autocmd bufreadpost * lua LoadDAPBreakpoints(<buffer>) where LoadDAPBreakpoints only loads breakpoints that were set in that file?

I don't get it. Do you want to load breakpoints for the just-opened buffer? If you do, this way may not work properly when users have some session manager plugin.

Weissle avatar Jan 02 '23 09:01 Weissle

I'm confused about why you would have to load breakpoints for every single file, rather than just the currently opened buffers.

I thought the desired behaviour was to seamlessly persist breakpoints across saving, quiting and reopening a file - and for this to happen for any file opened in a project.

Why would a session manager affect anything? If you open a file as part of a session, presumably you still want its breakpoints?

BlueDrink9 avatar Jan 03 '23 22:01 BlueDrink9

For now, this plugin will only load the breakpoints for opened buffer. The feature we talk about in this issue is a future feature and it will be optional. Don't worry about it. And actually you can have a try, add a breakpoint to a buffer, delete this buffer, then open nvim again. You will see this file is not loaded into the buffer.

Why would a session manager affect anything? If you open a file as part of a session, presumably you still want its breakpoints?

According to my observation, if we load a session automatically when we startup nvim, not all opened buffer will trigger event BufReadPost. So if we only load breakpoints for the buffer which triggers BufReadPost, other buffer's breakpoints may not be loaded. Thus, for now, this plugin will check all buffers' breakpoints when event BufReadPost is triggered.

Weissle avatar Jan 04 '23 04:01 Weissle