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

Filename parsed as nil when using netrw on Windows #83

Open
D4isDAVID opened this issue Oct 13, 2022 · 0 comments
Open

Filename parsed as nil when using netrw on Windows #83

D4isDAVID opened this issue Oct 13, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@D4isDAVID
Copy link

D4isDAVID commented Oct 13, 2022

Description

Using Windows, when launching nvim on a file then the backslash seperator is used, but when browsing files with netrw then the regular slash seperator is used, causing get_filename to return nil.

Neovim version

NVIM v0.8.0-1210-gd367ed9b2
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3

OS information

Windows 10 Home version 21H2 build 19044.2130

Steps to reproduce

  1. Setup presence.nvim with require('presence'):setup({ auto_update = true })
  2. Edit a file with nvim
  3. Presence is Editing ... as expected
  4. Enter netrw with :Ex
  5. Presence is Browsing netrw as expected
  6. Choose a file to edit
  7. Presence is still Browsing netrw and Parsed filename nil with no extension is logged

Logs

[presence.nvim] Setting up plugin for windows
[presence.nvim] Using Discord IPC socket path: \.pipediscord-ipc-0
[presence.nvim] Checking Discord IPC socket at \.pipediscord-ipc-0...
[presence.nvim] Using id cc7dd71d-2d27-4c18-b226-dd2876cc178e
[presence.nvim] Completed plugin setup
[presence.nvim] Getting nvim socket paths...
[presence.nvim] Executing command: `powershell.exe, -Command, (Get-ChildItem \.pipe).FullName | findstr 'nvim'`
[presence.nvim] Found unexpected Discord IPC socket type: nil
[presence.nvim] Handling BufEnter event...
[presence.nvim] Connecting to Discord...
[presence.nvim] Connected to Discord
[presence.nvim] Authorizing with Discord...
[presence.nvim] Wrote message to pipe
[presence.nvim] Authorized with Discord for d4
[presence.nvim] Parsed filename README.md with md extension
[presence.nvim] Getting project name for C:UsersmalchAppDataLocal^@vim-datasitepackpackerstartpresence.nvim...
[presence.nvim] Setting activity for C:UsersmalchAppDataLocal^@vim-datasitepackpackerstartpresence.nvimREADME.md...
[presence.nvim] Using file asset: { "Markdown", "markdown" }
[presence.nvim] Adding button with repository URL: https://github.com/andweeb/presence.nvim.git
[presence.nvim] Attaching buttons to activity: { {^@    label = "View Repository",^@    url = "https://github.com/andweeb/presence.nvim.git"^@  } }
[presence.nvim] Detected project: presence.nvim
[presence.nvim] Sync activity to all peers...
[presence.nvim] Setting Discord activity...
[presence.nvim] Wrote message to pipe
[presence.nvim] Set activity in Discord for README.md
[presence.nvim] Got nvim socket paths: {}
[presence.nvim] No other remote nvim instances
[presence.nvim] Got nvim socket paths: {}
[presence.nvim] No other remote nvim instances
[presence.nvim] Handling BufAdd event...
[presence.nvim] Handling BufEnter event...
[presence.nvim] Handling BufAdd event...
[presence.nvim] Handling TextChanged event...
[presence.nvim] Last activity sent was within 10 seconds ago, skipping...
[presence.nvim] Parsed filename presence.nvim with nvim extension
[presence.nvim] Getting project name for C:UsersmalchAppDataLocal^@vim-datasitepackpackerstartpresence.nvim...
[presence.nvim] Setting activity for C:UsersmalchAppDataLocal^@vim-datasitepackpackerstartpresence.nvim...
[presence.nvim] Adding button with repository URL: https://github.com/andweeb/presence.nvim.git
[presence.nvim] Attaching buttons to activity: { {^@    label = "View Repository",^@    url = "https://github.com/andweeb/presence.nvim.git"^@  } }
[presence.nvim] Detected project: presence.nvim
[presence.nvim] Sync activity to all peers...
[presence.nvim] Setting Discord activity...
[presence.nvim] Activity already set for C:UsersmalchAppDataLocal^@vim-datasitepackpackerstartpresence.nvim, skipping...
[presence.nvim] Activity already set for C:UsersmalchAppDataLocal^@vim-datasitepackpackerstartpresence.nvim, skipping...
[presence.nvim] Wrote message to pipe
Error executing vim.schedule lua callback: ...ata\site\pack\packer\start\presence.nvim/lua/lib/log.lua:32: Vim(echomsg):E114: Missing quote: "[presence.nvim] Set activity in Discord for presence.nvim\"
stack traceback:
        [C]: in function 'cmd'
        ...ata\site\pack\packer\start\presence.nvim/lua/lib/log.lua:32: in function <...ata\site\pack\packer\start\presence.nvim/lua/lib/log.lua:28>
[presence.nvim] Handling BufAdd event...
[presence.nvim] Handling BufEnter event...
[presence.nvim] Parsed filename nil with no extension
[presence.nvim] No status text for the given buffer, skipping...
[presence.nvim] Parsed filename nil with no extension
[presence.nvim] No status text for the given buffer, skipping...
@D4isDAVID D4isDAVID added the bug Something isn't working label Oct 13, 2022
@D4isDAVID D4isDAVID changed the title Filename is nil when using netrw on Windows Filename parsed as nil when using netrw on Windows Oct 13, 2022
NyCodeGHG added a commit to NyCodeGHG/presence.nvim that referenced this issue Dec 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant