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

Breaks when user settings are added #12

Open
NathanJang opened this issue Mar 5, 2015 · 2 comments
Open

Breaks when user settings are added #12

NathanJang opened this issue Mar 5, 2015 · 2 comments

Comments

@NathanJang
Copy link

I followed the advice on the default .sublime-settings and put this in my user configuration LaTeXWordCount.sublime-settings:

{
  "LaTeX": {
    "exclude_footnotes": false
  }
}

Then, when I run the word count, nothing appears to happen. This is printed on the console:

Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 549, in run_
    return self.run(edit)
  File "WordCount in /Users/jonchan/Library/Application Support/Sublime Text 3/Installed Packages/LaTeX Word Count.sublime-package", line 142, in run
  File "WordCount in /Users/jonchan/Library/Application Support/Sublime Text 3/Installed Packages/LaTeX Word Count.sublime-package", line 89, in wordcount_latex
TypeError: 'NoneType' object is not iterable

I've also tried this with "exclude_abstract": false. This doesn't happen when the user config file is deleted, and appears to happen even if a blank file is present.

@lionandoil
Copy link
Collaborator

Hmm the current version can't look up default values that are nested in other config elements, so as a workaround for now you could simply copy-paste the entire "LaTeX" configuration block and adjust the exclude-options in there, i.e. have this as your user package settings:

{
    "LaTeX": {
        "markup_commands": ["text\\w+", "uppercase", "uline", "emph", "caption"],
        "exclude_headers": false,
        "exclude_footnotes": false,
        "exclude_appendices": true,
        "exclude_abstract": false
    }
}

Please let me know if that works for you

@NathanJang
Copy link
Author

It does! Any ideas on how to fix it? I don't know Python, so I can't help.

mazunki added a commit to mazunki/SublimeLaTeXWordCount that referenced this issue Oct 19, 2019
Fixed issue kevinstadler#12 . I wasn't able to directly alter the values of setting through the API's .set() function, so I created a function returning a copy of the settings instead.

If someone knows how to load the default settings, that would be better than using a hardcoded dictionary with their values.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants