Set 'abbr' to empty string if not set
See original GitHub issueWhile setting up the new combine matcher (which is great, thanks!) for vimtex, I noticed that ncm2 initializes the abbr field to word in https://github.com/ncm2/ncm2/blob/master/pythonx/ncm2.py#L85. Is there a specific reason for this? This prevents me from matching word more strictly than abbr; for this purpose,
if 'abbr' not in e or type(e['abbr']) != str:
e['abbr'] = ''
would be needed. (This would also be more consistent with the other fields.)
Issue Analytics
- State:
- Created 5 years ago
- Comments:18 (9 by maintainers)
Top Results From Across the Web
c# shorthand for if not null then assign value - Stack Overflow
I get that, if testVar1 is null though I dont want testVar2 being set to anything at all as even if it's set...
Read more >3 Ways to Set Default Value in JavaScript | SamanthaMing.com
Let's break down the 3 different ways to set Default Values using logical operator, ternary, and if/else...
Read more >Empty string - Rosetta Code
Demonstrate how to check that a string is not empty. ... Strip a set of characters from a string · Strip whitespace from...
Read more ><abbr>: The Abbreviation element - HTML - MDN Web Docs
When an abbreviation is used and you want to provide an expansion or definition outside the flow of the document's content, use <abbr>...
Read more >Commands - fish shell
The default key binding can be set by specifying a SEQUENCE of the empty string (that is, '' ). It will be used...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

FYI, I’ve replaced the boring pure text explanation with a more interactive script example. https://github.com/ncm2/ncm2/commit/0bf906b76636dc6ac5635660e884229138b8608d
It should be way more helpful for debugging and understand how ncm2 works.
Ok, now both versions are available.