Skip to content

Commit c4041ae

Browse files
committed
Fix wrong buffer path when using netrw on windows (andweeb#83)
1 parent c1c5475 commit c4041ae

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lua/presence/init.lua

+6
Original file line numberDiff line numberDiff line change
@@ -758,6 +758,12 @@ end
758758

759759
-- Update Rich Presence for the provided vim buffer
760760
function Presence:update_for_buffer(buffer, should_debounce)
761+
762+
-- Since git always uses forward slashes, replace with backslash in Windows
763+
if self.os.name == "windows" then
764+
buffer = buffer:gsub("/", [[\]])
765+
end
766+
761767
-- Avoid unnecessary updates if the previous activity was for the current buffer
762768
-- (allow same-buffer updates when line numbers are enabled)
763769
if self.options.enable_line_number == 0 and self.last_activity.file == buffer then

0 commit comments

Comments
 (0)