Skip to content

Commit 565e8a6

Browse files
committed
feat: prevent drawing particles over text by default
1 parent a00f547 commit 565e8a6

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

lua/smear_cursor/config.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ M.particles_enabled = false -- When true, better to also set `never_draw_over_ta
142142
M.particle_max_num = 100
143143
M.particle_spread = 0.5 -- 0: no spread, 1: spread over entire cursor
144144
M.particles_per_second = 200
145-
M.particles_per_length = 0.5 -- per character width
145+
M.particles_per_length = 1.0 -- per character width
146146
M.particle_max_lifetime = 300 -- milliseconds
147147
M.particle_lifetime_distribution_exponent = 5
148148
M.particle_max_initial_velocity = 10 -- characters width per second
@@ -151,6 +151,7 @@ M.particle_random_velocity = 100 -- characters width per second
151151
M.particle_damping = 0.2
152152
M.particle_gravity = 20 -- characters width per second squared
153153
M.min_distance_emit_particles = 1.5 -- character widths
154+
M.particles_over_text = false
154155

155156
-- For debugging ---------------------------------------------------------------
156157

lua/smear_cursor/draw.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -910,6 +910,7 @@ M.draw_particles = function(particles, target_position)
910910
for row, row_cells in pairs(cells) do
911911
for col, cell in pairs(row_cells) do
912912
if row == target_position[1] and col == target_position[2] then goto continue end
913+
if not config.particles_over_text and vim.fn.screenstring(row, col) ~= " " then goto continue end
913914

914915
local num_dots = (cell[1][1] > 0 and 1 or 0)
915916
+ (cell[2][1] > 0 and 1 or 0)

0 commit comments

Comments
 (0)