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

Infoview autoclose #103

Closed
wants to merge 2 commits into from
Closed

Infoview autoclose #103

wants to merge 2 commits into from

Conversation

rish987
Copy link
Collaborator

@rish987 rish987 commented Jul 23, 2021

Working on this made me realize that we'll probably want to eventually decouple the concept of an infoview (which is just contains the pure tactic/term state data) from the "infoview view" window (the thing that can be opened/closed). Will work on this once we actually have some kind of persistent state feature with the infoview (e.g. #84).

Closes #43.

@rish987 rish987 changed the title Infoview/autoclose Infoview autoclose Jul 23, 2021
@codecov
Copy link

codecov bot commented Jul 23, 2021

Codecov Report

Merging #103 (0db73cd) into main (ba7562e) will decrease coverage by 6.44%.
The diff coverage is 100.00%.

❗ Current head 0db73cd differs from pull request most recent head 683d952. Consider uploading reports for the commit 683d952 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##             main     #103      +/-   ##
==========================================
- Coverage   92.15%   85.71%   -6.45%     
==========================================
  Files          25       17       -8     
  Lines        1109      686     -423     
==========================================
- Hits         1022      588     -434     
- Misses         87       98      +11     
Impacted Files Coverage Δ
lua/lean/infoview.lua 100.00% <100.00%> (+1.80%) ⬆️
lua/lean/init.lua 87.27% <100.00%> (ø)
lua/tests/current_search_paths_spec.lua 35.71% <0.00%> (-60.72%) ⬇️
lua/tests/trythis_spec.lua
lua/tests/sorry_spec.lua
lua/tests/infoview/run_spec.lua
lua/tests/ft_spec.lua
lua/tests/fixtures.lua
lua/tests/infoview/autoopen_spec.lua

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ba7562e...683d952. Read the comment docs.

function lean.is_lean_buffer()
local filetype = vim.opt.filetype:get()
function lean.is_lean_buffer(buffer)
local filetype = vim.api.nvim_buf_get_option(buffer or 0, "ft")
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a big fan of the OOP options but unfortunately I couldn't find a way to specify a particular buffer when using them.

@rish987
Copy link
Collaborator Author

rish987 commented Jul 23, 2021

Also while working on this I've already started to see intermittent MacOS failures (e.g. this one), so we may want to ask a maintainer about nvim-lua/plenary.nvim#186 soon!

@rish987 rish987 marked this pull request as draft July 23, 2021 22:11
skip-checks: true
@Julian
Copy link
Owner

Julian commented Jul 30, 2021

Honestly I don't see much purpose in having two concepts personally.

We have vim concepts already of windows and buffers. An infoview is a lean concept, if it has some contents, that can be a buffer to me.

@rish987
Copy link
Collaborator Author

rish987 commented Jul 30, 2021

Will create an issue for this, but how this is useful will become more clear once we've implemented #84. The idea is to be able to swap between infos with different pins (using a telescope picker) and let multiple infoviews share the same info. Figured we might as well decouple immediately (#105) because it makes the code easier to understand.

@Julian
Copy link
Owner

Julian commented Jan 3, 2022

It's likely easier to start from scratch here given the conflicts, so closing this one.

@Julian Julian closed this Jan 3, 2022
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

Successfully merging this pull request may close these issues.

Configurably autoclose the infoview if it has no Lean buffers updating it
2 participants