-
Notifications
You must be signed in to change notification settings - Fork 17
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
[Enhancement] Enhance Vertical Split Visual Clarity with Distinct Active Window Borders #59
Comments
I don't have any good ideas at the moment. Could you provide some guidance? |
I don't really have a good method to recommend either. How to label two vertically split windows largely depends on personal aesthetics. Perhaps, using "」" for the left and "「" for the right, utilizing a bit more horizontal extension to mark the current window. I haven't actually tested this method, so it might not be truly suitable. |
This sounds to be a very reasonable idea, just make the end piece of the separator line a corner that points towards the active pane. |
2024-05-20_23-03-33.mp4 |
Edit the config.light_pollution callback function, which passes the current dividing line light_pollution = function(lines)
local v_smooth = 0
local s_smooth = 0
for dir, line in pairs(lines) do
local timer = vim.uv.new_timer()
local height = line:height()
timer:start(
1,
50,
vim.schedule_wrap(function()
local status = true
if line:is_show() and (dir == "h" or dir == "l") then
if v_smooth ~= line:height() then
status = false
local symbol = line.body_symbol
if v_smooth == 0 then
symbol = line.start_symbol
end
if v_smooth + 1 == height then
symbol = line.end_symbol
end
line:pos_color(v_smooth, 0, "Error", symbol)
v_smooth = v_smooth + 1
end
end
if status and not timer:is_closing() then
timer:stop()
timer:close()
end
end)
)
local timer2 = vim.uv.new_timer()
local width = line:width()
timer2:start(
1,
4,
vim.schedule_wrap(function()
local status = true
if line:is_show() and (dir == "j" or dir == "k") then
if s_smooth ~= line:width() * 3 then
status = false
local symbol = line.body_symbol
if s_smooth == 0 then
symbol = line.start_symbol
end
if s_smooth + 1 == width then
symbol = line.end_symbol
end
line:pos_color(0, s_smooth, "Error", symbol)
s_smooth = s_smooth + 1
end
end
if status and not timer2:is_closing() then
timer2:stop()
timer2:close()
end
end)
)
end
end,
|
That is very cool but I don't see how it address this issue in particular. I think you should be able to insert an indicator either on either end or the midpoint of the diving line. Idk how it would be implemented but imagine a config like:
|
light_pollution = function(lines)
for dir, line in pairs(lines) do
if line:is_show() and (dir == "h" or dir == "l") then
if dir == "h" then
line:pos_color(line:height() / 2, 0, "Error", ">")
elseif dir == "l" then
line:pos_color(line:height() / 2, 0, "Error", "<")
end
end
end |
Description
When using the plugin with a vertical split layout containing only two windows, it becomes difficult to discern which window is currently active because there is only a single dividing line between them. This can lead to confusion and inefficiency, as users might type or perform actions in the wrong window.
Expected Behavior
I would like to propose a feature where there is a more distinct visual cue to indicate the active window when only two windows are present in a vertical split layout.
Current Behavior
At present, the plugin indicates the active window in a vertically split view by lighting up only half of the dividing line: the upper half if the right window is active, and the lower half if the left window is active. While this does provide an indication of which window is focused, the signal is quite subtle and can be easily overlooked.
Steps to Reproduce
Additional Information
This enhancement would greatly improve the user experience by making it easier to identify the active window at a glance, especially for users who frequently switch between only two vertical split windows.
Thank you for considering this feature request. I believe it would benefit many users of your plugin.
The text was updated successfully, but these errors were encountered: