Comments (8)
@nyngwang The event handler I gave you assumes that you are only using the filesystem
source and will not have any other sources open. It needs to be re-written to be aware of which source triggered the event.
Maybe auto-preview does need to be handled in core, even if it is enabled and/or configured per source.
from neo-tree-diagnostics.nvim.
My apologies, I don't know how I didn't notice this. I'm working on fixing it but I'm having trouble seeing what's happening.
Are you sure that autopreview = false
also gives an error? I'm not seeing the same thing.
from neo-tree-diagnostics.nvim.
@mrbjarksen I also made this issue in a hurry. Here is the missing context that I consider the culprit to this issue:
event_handlers = {
{
event = 'after_render',
handler = function ()
local state = require('neo-tree.sources.manager').get_state('filesystem')
if not require('neo-tree.sources.common.preview').is_active() then
state.config = { use_float = false }
state.commands.toggle_preview(state)
end
end
},
-- some other events.
},
and regarding my aforementioned testing on neo-tree-diagnostics.nvim side, I have tried with or without the commented-out config:
diagnostics = {
autopreview = false,
-- autopreview_config = { use_float = false },
-- autopreview_event = 'neo_tree_buffer_enter', -- also tried changing it to 'after_render'. Also got an error.
window = {
mappings = {
['<cr>'] = function (...)
local cur_win = vim.api.nvim_get_current_win()
require('neo-tree.sources.diagnostics.commands').open(...)
vim.api.nvim_set_current_win(cur_win)
end
},
},
},
(if a better title can be used, please let me know. I'm not sure whether or not you can change it.)
from neo-tree-diagnostics.nvim.
I just pushed a commit which fixes things on my end (9a78e75). If it doesn't work for you, try disabling your event handler, the interplay between them might be causing issues.
from neo-tree-diagnostics.nvim.
I still got the error if I keep the event as above.
Error in event handler for event after_render[table: 0x01034d1148]: ...im/site/pack/packer/start/nui.nvim/lua/nui/tree/init.lua:254: Expected Lua number
[...] If it doesn't work for you, try disabling your event handler, [...]
But then I will assume that the ability to preview on filesystem source will be disabled. Do you have any alternative regarding that?
from neo-tree-diagnostics.nvim.
After some testing I think this will be helpful: If I call the toggle to open diagnostics.nvim when my cursor is at neo-tree, then no error will be shown.
from neo-tree-diagnostics.nvim.
Maybe auto-preview does need to be handled in core, even if it is enabled and/or configured per source.
Yes, I think that would probably be a good idea. My solution was more involved than I originally thought it would be.
from neo-tree-diagnostics.nvim.
@cseickel Then maybe this could be put into a new issue on neo-tree side and feel free to postpone it if there are issues of higher priority. I'm happy to know that this bug is indeed triggering the improvement of neo-tree to be a more powerful daily tool :)
[...] If I call the toggle to open diagnostics.nvim when my cursor is at neo-tree, then no error will be shown link
I will use this as a workaround and wait for the update.
from neo-tree-diagnostics.nvim.
Related Issues (13)
- Status of "preview" code? HOT 1
- Improve rendering multi-line diagnostic messages HOT 2
- Enable overriding diagnostic symbols and highlights HOT 1
- Is it possible to jump to that line on `<CR>`? HOT 2
- The `follow_current_file = true` doesn't seem to work HOT 5
- The highlight of keyword from `'preview'` cannot be cleared with `:noh` HOT 3
- `reveal` does not respect `follow_behavior` HOT 4
- Support for TODO comments HOT 1
- Error arised when move focus from neo-tree-diagnostics window to a normal window HOT 4
- Control auto-refresh with config option HOT 6
- Alternate renderer for diagnostics.. WIki? HOT 3
- Warning Invalid mapping for HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from neo-tree-diagnostics.nvim.