Menu

#1260 [PATCH] Fix inconsistency with dot styling in Nim

Committed
closed
5
2019-03-07
2019-01-27
Jad Altahan
No

Small fix for pragmas ({. .}). The dot before } should not be styled as an identifier if the previous character is an identifier.

img

1 Attachments

Discussion

  • Jad Altahan

    Jad Altahan - 2019-01-28

    Please ignore this patch for now. I'm looking into something better.

     
  • Jad Altahan

    Jad Altahan - 2019-01-28

    Could you please change the ticket title to "[PATCH] Fix inconsistency with dot styling in Nim"?

    The issue was broader than I thought. Dots were inconsistently being styled as both SCE_NIM_IDENTIFIER and SCE_NIM_OPERATOR depending on what the previous character is. Now it's all fixed and dots are always considered an operator.

    Before:
    img1

    After:
    img2

     
  • Neil Hodgson

    Neil Hodgson - 2019-01-28
    • summary: [PATCH] Fix pragma-end styling in Nim lexer --> [PATCH] Fix inconsistency with dot styling in Nim
    • Group: Committed --> Completed
     
  • Neil Hodgson

    Neil Hodgson - 2019-01-29
    • Group: Completed --> Committed
     
  • Neil Hodgson

    Neil Hodgson - 2019-01-29

    Pictures can show styling issues but these ones are difficult to differentiate as one '.' is just a bit smaller and greyer than the other. Using a background colour with style.nim.15=bold,back:#D0F0FF make it easier to see.

    Including a copy of the example as text helps further by allowing the text to be cut and paste which is less effort and does not suffer transcription errors.

    To ensure that this change is checked automatically in the future, I have added a unit test test/examples/x.nim with its corresponding x.nim.styled. To run the test on Windows, build bin/SciLexer.DLL then python lexTests.py. If the lex produces a different result to x.nim.styled then the new lex is saved to x.nim.new and the differences can be examined. If the new lex is correct, then move it to x.nim.styled and include x.nim.styled in the patch. For a new feature or bug fix, add an example to x.nim, run the test, and update x.nim.styled from x.nim.new if correct.

    Changes committed as [99281d].

     
    👍
    1

    Related

    Commit: [99281d]

    • Jad Altahan

      Jad Altahan - 2019-01-30

      I'm trying to run the test. Executed lexTests.py, but it just returns "Can't find SciLexer.DLL". Traced that return value to an exception in XiteWin.py. Am I missing something here? My scintilla\bin directory has the following:
      Imgur

       
      • Neil Hodgson

        Neil Hodgson - 2019-01-30

        Ensure the current directory is scintilla/test.

        The Python executable and SciLexer.DLL must match in word-size. Use a 64-bit SciLexer.DLL with a 64-bit Python, and similarly with 32-bit executables. You can check Python's architecture with

        python -c "import platform;print(platform.architecture())"
        
         
        • Jad Altahan

          Jad Altahan - 2019-01-30

          Thanks for the help. I was running a 32 bit Python against a 64 bit DLL. ¯_(ツ)_/¯

           
  • Neil Hodgson

    Neil Hodgson - 2019-03-07
    • status: open --> closed
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.