Menu

#243 Feature request: Make syntax highlight configurable

2.3.3
New
nobody
None
High
Task
2017-07-07
2017-05-22
Ronald
No

BowPad seems to guess somehow, what kind of Syntax Highlighting is done for a certain document. For example, I have a file .irbrc, which I would expect being highlighted as Ruby file, but it is highlighted as bash file.

I suggest that the user can somehow control the highlight mode. For example, one could supply a list of filename patterns for each highlight mode, or BowPad could look in the first few lines of a file for a "mode line" indicating the highlight mode, as Emacs or jEdit are doing.

Discussion

  • Stefan Kueng

    Stefan Kueng - 2017-06-09

    go to "configure styles" (in the "other" tab).
    Then in that dialog, select "Ruby" from the "Language" combobox. And then at the bottom, enter the extension "irbrc". Separate multiple file extensions with ";". The click ok.

    BowPad also remembers if you change the lexer for a loaded file, so the next time you load that file that same lexer is used instead of the default one set in the styles dialog.

     
    • Ronald

      Ronald - 2017-06-12

      This is great!

      May I suggest that the Style Configurator Window contains a small help
      text (or tooltip), explaining - maybe with an example - that the
      extensions should be separated by semicolon, as this is not obvious.

      Ronald

      On Fri, Jun 9, 2017, at 20:07, Stefan Kueng wrote:

      go to "configure styles" (in the "other" tab).
      Then in that dialog, select "Ruby" from the "Language" combobox. And then
      at the bottom, enter the extension "irbrc". Separate multiple file
      extensions with ";". The click ok.

      BowPad also remembers if you change the lexer for a loaded file, so the
      next time you load that file that same lexer is used instead of the
      default one set in the styles dialog.


      [tickets:#243] Feature request: Make syntax highlight configurable

      Status: New
      Milestone: 2.3.3
      Created: Mon May 22, 2017 03:23 PM UTC by Ronald
      Last Updated: Mon May 22, 2017 03:23 PM UTC
      Owner: nobody

      BowPad seems to guess somehow, what kind of Syntax Highlighting is done
      for a certain document. For example, I have a file .irbrc, which I would
      expect being highlighted as Ruby file, but it is highlighted as bash
      file.

      I suggest that the user can somehow control the highlight mode. For
      example, one could supply a list of filename patterns for each highlight
      mode, or BowPad could look in the first few lines of a file for a "mode
      line" indicating the highlight mode, as Emacs or jEdit are doing.


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/bowpad-sk/tickets/243/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       
  • Stefan Kueng

    Stefan Kueng - 2017-06-13
     

    Related

    Commit: [r2025]

  • Ronald

    Ronald - 2017-06-16

    It turned out that it worked for Ruby, but now I had a case where it didn't work: I also had changed the configuration for the Bash style, setting the Extension string to

    .bash;.bashrc;.sh;.sh_once;.zsh;.zshrc
    

    Now, a couple of days later, I opened a file with name common_show.zsh, and it was rendered as Text, not as Bash. Of course I could manually select the lexer, but I wonder why my settings did not invoke the lexer automatically. Could it be caused by the underscore in the filename?

     
  • Stefan Kueng

    Stefan Kueng - 2017-07-07

    You have to set the extension string without the dots:
    bash;bashrc;sh;sh_once;zsh;zshrc