Comments (7)
Yep, sorry been a little busy. Will test and merge it over the weekend
from nvim-scrollbar.
Should be rather easy once #26 is merged, either as a handler in your configs or in the project, if @petertriho wants to include this.
from nvim-scrollbar.
Now that custom handlers exist, I wrote a simple handler to support entries in the location list.
require("scrollbar.handlers").register("locationlist", function(bufnr)
local winnr = vim.fn.get(vim.fn.win_findbuf(bufnr), 0, -1)
if winnr == -1 then
return {}
end
local ll = vim.fn.getloclist(winnr)
local marks = {}
for _, entry in pairs(ll) do
table.insert(marks, { line = entry.lnum, type = mark_type_map[entry.type]})
end
return marks
end)
Should I create another pull request and add this as an example in the readme or create a dedicated handler script?
Unfortunately, there is no autocmd for when the location list was updated, so the markers don't refresh automatically until one of the configured autocmds is triggered, e.g. scrolling.
I also tried the following, but that also didn't work.
augroup scrollbar_loclist
autocmd!
autocmd User ALELintPost,ALEFixPost,CocDiagnosticChange lua require('scrollbar.handlers').show();require('scrollbar').render()
augroup END
from nvim-scrollbar.
This is something I definitely want to add as a in-built handler and, eventually, add a wiki for other things.
I'll investigate further over the weekend, but have you tried:
" quickfix
autocmd QuickFixCmdPost [^l]* lua require('scrollbar.handlers').show();require('scrollbar').render()
" location
autocmd QuickFixCmdPost l* lua require('scrollbar.handlers').show();require('scrollbar').render()
Probably should refactor require('scrollbar.handlers').show()
to accept an optional handler name + buffer number to only update that handler
from nvim-scrollbar.
I've tried QuickFixCmdPost
but it doesn't work, too. According to the docs it only applies to the quick fix list.
from nvim-scrollbar.
Looks like we'll need to handle both QuickFixCmdPost
and Filetype qf
autocmds to support qf/location list but the scrollbar render implementation needs to change since it only works with current buffer/window
local function qf_test()
local winid = vim.api.nvim_get_current_win()
local info = vim.fn.getwininfo(winid)
local winnr = info[1].winnr
local loclist = vim.fn.getloclist(winnr)
end
vim.api.nvim_add_user_command("QuickfixTest", qf_test, {})
-- autocmd Filetype qf QuickfixTest
from nvim-scrollbar.
Ok, to be more precise, the autocmds get called, but the location list has not been updated at this point.
I haven't implemented a quickfix list handler, yet.
from nvim-scrollbar.
Related Issues (20)
- [Question] How to configure colors? HOT 1
- Support Z-Index
- Window local Show / Hide Scrollbar
- Autohide
- Grabbable scrollbar
- Bold Marks? HOT 3
- [FR] `tanvirtin/vgit.nvim` support
- nvim-scrollbar does not show Search marks no matter the configs. HOT 9
- Option to make ScrollbarHandle lay on top of all other marks when scrolling?
- Question: Check is scrollbar is active HOT 2
- Exclude filetypes? HOT 2
- Error during quick scroll up and down
- How to disable the nvim-scrollbar on specific window HOT 1
- Scrollbar on the left side of the window HOT 1
- [Help] How to configure scrollbar like demo GIF HOT 2
- Opening files with linenum greater than the screen height doesn't work HOT 1
- Script Error HOT 2
- Question: How can I disable nvim-scrollbar on nvim-cmp? HOT 4
- [FR] vim-signify support
- Cannot see a letter on the end of a line HOT 4
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 nvim-scrollbar.