f-strings in python not detecting variable between "{ }"; Is this intentional? #220
Replies: 3 comments
-
Hi @robertdefilippi 👋, thanks for your contribution 👍 As you already said both ports are targeted for different applications which use totally different engines and parsers to detect code tokens. In case of Pycharm there would be only a single way to change it since they provide a single theme API, but for Vim there are many ways. First off there are many plugins that provide highlighting support for a specific language, but use different regular expressions to detect these. To modify the braces we need to know if either Vim's bundled syntax parser or a third-party (plugin) is currently active. The next step would be to get the name of the highlighting group that catches the brace characters. " Shows syntax highlighting groups for the current cursor position
nmap <C-S-K> :call <SID>SynStack()<CR>
function! <SID>SynStack()
if !exists("*synstack")
return
endif
echo map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")')
endfunc You can add it to your |
Beta Was this translation helpful? Give feedback.
-
Hi @arcticicestudio, my apologies for not responding to this sooner. After putting in the function to my .vimrc I get the following response:
I also ended up adding this to my
I'm not sure if that is helpful, but it fixed the syntax highlighting issue I mentioned above. |
Beta Was this translation helpful? Give feedback.
-
Thank you for your patience! 🙏🏼 I recently published the first “Northern Post — The state and roadmap of Nord“ announcement which includes all details about the plans and future of the Nord project, including the goal of catching up with the backlog. This issue is part of the backlog and therefore I want to triage and process it to get one step closer to a “clean state“. Read the announcement about reaching the “clean“ contribution triage state in Nord‘s discussions for more details about the goal. Due to the scope of this issue of not being “purely technical“, or being related to the project‘s code at all, I‘ll convert it into a discussion for Nord‘s central community hub on GitHub. This way the repository is easier to maintain by separating conversations about the actual code while also making help requests, ideas and other contributions from users more visible and supportable by the community. @robertdefilippi Would be nice if you could quickly check if this discussion can be closed since this is not related to this theme‘s code but the parser implementation. |
Beta Was this translation helpful? Give feedback.
-
Hi,
I'm just going through this theme and I love it! It fits so well with the rest of my setup.
I'm just wondering about f-strings in Python and how they are formatted.
In the first image I have a f-string from my neovim using this theme.
The second image is from my pycharm using this plugin (https://github.com/arcticicestudio/nord-jetbrains) Same repository owners, but different implementation ... I know. I just find reading the code below is much cleaner as I can differentiate between the "{}" and the variable with the curlies when writing f-strings.
I was just wondering if I could (how to?) edit this plugin so f-strings are highlighted the same way they are in pycharm. Even if I'm pointed in the right direction, I'm sure I could work through the implementation.
Thanks,
Beta Was this translation helpful? Give feedback.
All reactions