Search code examples
luanotepad++spell-checking

Extend Lua language settings in Notepad++ to spell-check also stuff enclosed in `[[ ... ]]`


I am currently going through the lua files of LaTeX's TikZ/PGF code and among other things I want to correct spelling errors because parts of these lua files are also used for the manual.

To do this I use Notepad++ but as it seems, stuff enclosed in [[" ... "]] is not spell-checked. Here an example from the file DistanceMatrix.lua were I introduced a spelling error.

declare {
  key = "distance matrix verticess",
  type = "string",

  summary = [["
    A list of verticess that are used in the parsing of the
    |distance matrix| key. If this key is not used at all, all
    vertices of the graph will be used for the computation of a
    distance matrix.
  "]],

In the left of the following image one sees the result when Lua is the active language and on the right when TeX is the active language.

image showing the above code in Notepad++ when using languages Lua (left) and TeX (right)

As can be seen the word "verticess" is not underlined in the summary part when Lua is the active language.

Is it possible to extend/modify the Lua language in Notepad++ thus that also the parts enclosed in [[" ... "]] are spell-checked? (Maybe it would also be sufficient to spell-check stuff in [[ ... ]] thus without the quotes? Unfortunately I am not familiar with the Lua language.) And of course, if this is possible, how?


Solution

  • TeX is cheating somewhat based on how it's language style is defined. The TeX definition recognizes spelling errors in variable names: enter image description here

    This can be an annoyance for many people.

    If it is acceptable for your needs using an older version of DSpellCheck(1.3.5 or older) you can uncheck the Check Only Comments and Strings if Possible setting of DSpellCheck to apply it this behavior to all languages:

    enter image description here


    Example of Lua language setting after change: enter image description here