-
-
Notifications
You must be signed in to change notification settings - Fork 836
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
Buffers rework (indicators and sorting) #208
Conversation
a66adf9
to
4ac2f86
Compare
@Conni2461 |
0e4e4ad
to
c784cbe
Compare
Thanks that made it clearer for me. I got the other think working(active line should be previous buffer), but i think @tjdevries would not be happy with this code. It's currently pretty hacky and i think it should only work with But could you test it anyway @Stanislav-Lapata? I would clean up the code tomorrow, @tjdevries. |
c784cbe
to
fbe13e5
Compare
@Conni2461 Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --bin' }
Plug 'junegunn/fzf.vim' And run You shouldn't repeat fzf.vim logic fully. I would just do sorting for a start and show all buffers without disabling current buffer. Sorry for my English |
fbe13e5
to
923ca7a
Compare
@Stanislav-Lapata Both |
@Conni2461 |
923ca7a
to
eecd66d
Compare
eecd66d
to
647a134
Compare
@Conni2461 I will probably take some of the code you have there for making a display table and do something very similar and then you can rebase this branch off of it at some point. I will take a look at the other parts, particularly the selection strategy stuff, later. If you want to submit a separate PR for the selection strategy fixes, I will definitely take a look. Thanks! |
The |
42f6ce0
to
4846f95
Compare
e7c09d9
to
78d950b
Compare
5b3de56
to
6ac2a8e
Compare
@tjdevries Should be good to review. If you find some time. |
7688a97
to
6930b34
Compare
ce88cd0
to
eb1d8c3
Compare
vim.fn.bufload(bufnr) | ||
|
||
vim.cmd([[doautocmd filetypedetect BufRead ]] .. filename) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does calling bufload do this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes i think so. I have highlighting for unloaded buffers and it seems like for loaded buffers i don't have to do anything
eb1d8c3
to
cbcf4bd
Compare
1e14ff8
to
acb4e59
Compare
What's left for this PR? |
|
13fc451
to
8167ce8
Compare
8167ce8
to
b61c104
Compare
@tjdevries Should be done from my side. You can take a look at this. |
…o builtin_runner_insert_issue * 'master' of github.com:nvim-telescope/telescope.nvim: Refactor builtin (#287) fix: Use noremap when mapping. (#286) Fix the bug report template to suggest -u Add gitter tag feat: highlighter only Filter the completion of the command (#279) feat: Buffers rework (indicators and sorting) (#208) feat: v0.1 of extensions (#278) Register finder (#275) Various previewer fixes (#260) docs: fix builtin table formatting (#272) feat: Add highlights builtin (#267) Fixed minor typos (#271) Feat: Add filetypes builtin (#263) Fix: cwd detection of builtin.git_ (#264)
Close #179
Close #245
This is currently WIP. Basically it is hacked together.This reworks
builtin.buffers
, so that we also display the indicators.I'm currently parsing the output of
:buffers
. I'm not sure if i can get the indicators on another way.This currently shows all buffer, also unloaded buffers. (So(Should now work as before)show_all_buffers = true
does nothing)This also adds a function, which could help us display outputs in a more table like format, like suggested in #118.
This does not change the other builtins to be to a table format. (I plan to do this in another pr).
I also briefly looked into #179 and i think we can useunpack(vim.fn.getbufinfo(tonumber(bufnr))).lastused
to sort the buffers list. (I think this should be configurable. either pick the current solution or based on lastused.). I might do this in this PR aswell. If I can figure out how the whole sorting part works.Previous Buffer is default selection. Should be configurable. Configurable with
sort_lastused = true
@sunjon Would be great if you could comment the new layout(display output with the indicators).
Currently does not handle readonly buffers.If no buffer has a write indicator the column will not be printed.@Stanislav-Lapata and @sunjon when i sort the buffers after lastused, do you want the active buffer be displayed or should we filter out the current one?