Syntax Highlight in a JTextPane

How can I create syntax highlight in a JTextPane?

import javax.swing.*;
import javax.swing.text.*;
import java.awt.Color;
public class MultiColouredText extends JFrame {
   public MultiColouredText() {
      StyledDocument doc = new DefaultStyledDocument();
      JTextPane pane = new JTextPane(doc);
      pane.setEditable(false);
      pane.setFont(new java.awt.Font("Verdana", 0 , 16));
      MutableAttributeSet mas = new SimpleAttributeSet();
         try {
            StyleConstants.setForeground(mas, Color.yellow);
            StyleConstants.setBackground(mas, Color.blue);
            doc.insertString(doc.getLength(), " Hello ", mas);
            StyleConstants.setForeground(mas, Color.red);
            StyleConstants.setBackground(mas, Color.lightGray);
            doc.insertString(doc.getLength(), " World ", mas);
         catch (Exception ignore) {}
      getContentPane().add(pane);
      setSize(150,56);
      setDefaultCloseOperation( EXIT_ON_CLOSE );
   public static void main(String[] args) {
      new MultiColouredText().show();
}

Similar Messages

  • Syntax highlighting using JTextPane

    Hello,
    Does somebody know how to achieve quick, efficient syntax highlighting using JTextPane. I have tried it out by actually removing and reinserting the colored text, but it is way too slow. It is worse if I do it in a thread. It will be a great help if somebody bails me out of this problem.
    S. Senthil kumar

    Let me see if I understand your problem...you are attempting to open a fairly large file and then highlight certain portions of the text. You're asking for help on how to efficiently do this and several people gave you links on how to highlight text which leads to your last question about the files taking too long to load. How big are these files you're talking about and how long does it take for them to load? What time is acceptable? Remember, all commercially available document display programs have a certain load time which grows larger as the document it is attempting to display grows in size.
    -Kevin

  • Help required in syntax highlighting in xml using tool Syntax

    hi
    i am using Syntax tool for syntax highlighting of xml in JTextpane. I use complex html style and i want to change the colors of the displayed xml in the tool under complex html like the internet explorer displays in case of xml i want to make my xml like that..

    Hi,
    use it like this if Fname equals constnat[space] then pass the Constant[space] to Fname else value of Fname as under
    ................................Constant[]------>
    FNAME.............................................Then
    >Equals....................................IF -
    >FNAME
    Constant[].........................................ELSE
    .......................................FNAME---->   
    Constant[]    = Constant [ Space ]
    Sachin

  • XML Syntax highlighting (again :)

    Hi there,
    I know, that there have been quite a view posts about this topics, but as far as I see, there has been no solution to this.
    So I wanted to ask if someone has implemented a XML Syntax highlighting or knows where to get a tutorial from to accomplish so (inheriting from DefaultStyledDocument...?)
    Sincerely
    Charly

    Hi!
    I have the same need: an XML Syntax Highlighting (coloring).
    I don't need an XML editor, I have a JTextPane that shows XML code and I would like it to be done with a syntax coloring.
    If you have a solution I will really appreciate!
    Thanks
    Gio :-)

  • Syntax Highlighting w/ Swing Text Package

    I have a question for you that I hope ever so much that you could answer just in the most abstract sense, I will figure out the code from what you have said hopefully. Any relavent parts that you think I should know, please point out.
    My question is, I'm trying to implement Syntax Highlighting for a code editor in Java (yes I know, like everyone else. It would REALLY be helpful if you did an updated Demo of a SyntaxEditor for JDK 1.4 BTW) anyway, I have already implemented Syntax Highlighting by overriding the PlainView and changing its drawLine method to parse the line, find the key words then draw them accordingly. However I cannot get over the sinking feeling that there is a better way to do this in JDK 1.4, I'm not worried about backward compatability. I'm only interested in the "sexiest" way to do this with Java. I started looking into the GlyphView, and that seems more of what I want, it has more control over the text elements and strong drawing abilities, I also noticed the GlyphPainter1 and GlyphPainter2, I tried to extend GlyphPainter2 and use it with my extended GlyphView and just change its paint method to parse the lines, but the class complains about not being public, even though in the source its class definition is "public class GlyphPainer2 extends GlyphView.GlyphPainter" which confused me.
    But at any rate, my basic question is how would YOU, implement Syntax Highlighting (code coloring) if you could do it from scratch with all the facilities of the 1.4 JDK. ALso, should I look into the Java2D API or is this over kill for what I'm doing? I just need a basic code color'er, nothing fancy. But I need the fonts and styles to be able to change, that's all. And international support would be nice.
    The type of answer I'm hoping for is something like "Create a new editor kit and then extend the GlyphView class and override its XYZ method to do your line parsing and then override the ABC method to do the actual painting of the line, this is the best way to do this in java"
    Best wishes,
    -rsk123

    I am searching for text highlighting code in java during 7 days.
    And I also agree with Mr. rsk123 's thought.
    I want to make editor to highlight code using java's general text package.
    But I can't find good source or class to satisfy me.
    Some code run well but it's not use the original java text package.
    Some code was made by using java text package but have a bug and not run pefectly.
    Now, I must choice a code for text highlighting.
    But until now I can't find a free code or comecial code for it.
    Anyway, I summarize my suffing result until now.
    ** I have stuied,
    . About java's text package in Swing Connection site.
    It's useful a little to understand the text package structure.
    (http://java.sun.com/products/jfc/tsc/articles/index.html)
    . How to make own EditorKit in 'Java Swing' book chapter 24.
    I think it's good. But difficult to read.
    (published by O'REILLY. Robert Eckstein)
    ** I have found program and have tested.
    1) JEdit (http://www.jedit.org)
    2) Jext(http://www.jext.org)
    3) Sun's sample using the JavaEditorKit
    (http://java.sun.com/products/jfc/tsc/articles/text/editor_kit/index.html)
    4) Ostermiller's Syntax editor (http://ostermiller.org/syntax/editor.html)
    5) j (http://armedbear-j.sourceforge.net/)
    6) je 1.66 (http://mathsrv.ku-eichstaett.de/MGF/homes/grothmann/je/)
    *** Detail descriptions of the test
    1. May be run well but not use java text package.
    ==> JEdit (http://www.jedit.org), Jext(http://www.jext.org)
    - I executed JEdit and Jext program. it works very well.
    I think It's greate programs.
    - The editor class for these programs are
    org.gjt.sp.jedit.textarea.JEditTextArea class.
    The JEditTextArea class extends JComponent, not java text component.
    - JEditTextArea class started from 'jedit syntax package project'.
    You can download the syntax package if you only use syntax highlighting
    from http://syntax.jedit.org/ .
    - JEdit and Jext use for editor 'jedit syntax package' but have upgrade that
    package their own effort(may be)
    - For me, It's an only product run well without error.
    But unfortunately it's not use java text component.
    So I hesitane to use it.
    Because I should make almost code to support general editor function which
    supported in JTextComponent.
    2. Provided by Sun's developer site.
    ==> JavaEditorKit (http://java.sun.com/products/jfc/tsc/articles/text/editor_kit/index.html)
    - It's made using JEditorPane. Great!!
    And have a good architecture. (I think)
    - But It use Scanner class which located in tools.jar package and
    have a bug which not supporting well comment syntax /* */.
    (Refer to http://developer.java.sun.com/developer/bugParade/bugs/4323090.html)
    Futhermore it display terrible exception message when typed "/*" string
    in the end position of java file. (I tested it)
    - I heard in the forum, someone made the own scanner class.
    (http://forum.java.sun.com/thread.jsp?thread=120564&forum=57&message=316083)
    He said,(he = rofshi)
    I wrote for my purposes a scanner based on the StreamTokenizer
    cl*** and set a corresponding object in the JavaView cl*** of
    the JavaKitTest.
    Then I placed the method of my Scanner cl*** that parses the
    given string and paints tokens in the method drawUnselected
    Text (instead of previous code).
    Of course, I erased all of the previous code related to the
    java Scanner.
    - For me, I like this style code and want to use it.
    But Scanner class have some bug and I can't cure that bug. Terrible...
    3. using JTextPane
    ==> http://ostermiller.org/syntax/editor.html
    - At first it's too slow.
    My computer is PentiumIII 350MHz Ram:256M Windows2000Por
    But when I press pgDown key quickly the display couldn't follow it.
    - And may be not support unicode.
    When I typed international code, exceptions displayed.
    (too much exceptios. may be caused repeating by thread.)
    (ArrayIndexOutOfBoundsException in JavaLexer.java 1022 ?)
    - For me, supporting international code is essential.
    So I can't use it.
    4. Do work well. But it use not understandable code for me.
    (not use general java text package)
    1)http://armedbear-j.sourceforge.net/
    2)http://www.rene-grothmann.de
    *** Finally, I have plan to make my own code using Mr rsk123's idea.
    (using GlyphView in jdk1.3 or jdk1.4)
    *** If you have a good information for text highliting of free code or
    comecial code pleas notify me.
    My address is [email protected]

  • Syntax highlighting not working with label on if statement in fortran in Visual studio 2010

    I am having a difficult time in figuring out the syntax highlighting in Visual studio. I am using fortran code and there are labels in if statements as follows: 
                if_2003: IF (FRAC_PBED(NNSED,L).LT.0.0.AND.
         +                   FRAC_PBED(NNSED,L).GT.SMALL_NEG_NO) THEN
                  FRAC_PBED(NNSED,L) = 0.0
           TSED_PBED(1,NNSED,L) = 0.0
         END IF if_2003
    So the problem I am having is when I click on the `if` next to label `if_2003`, then I cannot use `CTRL + ]` to move to the ending `if`. If there is no label before `if`, then the shortcut is working fine. I don't know what I could do so that it would start
    behaving as it is supposed to. 
    In the contrary, when I have do loop as follows: 
        do_410: DO NNSED=1,NSTD
             D50AVG(L) = D50AVG(L) + 
             +                 FRAC_ALAY_SURF(NNSED,L)*D50(NNSED)/10000.  ! BASED ON BED COMPOSITION
        C
             TSED_ALAY_SURF(2,NNSED,L)=TSED_ALAY_SURF(1,NNSED,L)
             TSED_ALAY_BUFF(2,NNSED,L)=TSED_ALAY_BUFF(1,NNSED,L)
             TSED_PBED(2,NNSED,L)=TSED_PBED(1,NNSED,L)
                  END DO do_410
    I can move to the end/start of `do` loop using the keyboard shortcut `CTRL + ]`. Any suggestions is appreciated.  
    Regards, Jdbaba

    Hello Jdbaba,
    Based on my research, your post is related to use fortran in Visual Studio:https://software.intel.com/en-us/articles/intel-math-kernel-library-intel-mkl-for-windows-build-intel-mkl-program-with-intel-fortran-in-microsoft-visual-studio This
    technology is provided by Intel. So the question should be consulted on Intel fortran related forum. Not Visual Studio Setup forum, setup forum is about install/uninstall Visual Studio.
    Best regards,  
    Barry
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Different Styles in PlainView - Syntax Highlighting?

    Hi,
    I've managed to extend PlainView and looking at old JEdit code I have the syntax highlighting working for the most part. However, at certain times while typing the cursor starts to get way ahead of the text it's typing. And as I backspace on the line the cursor eventually gets closer to the character the closer it gets to the start of the line.
    I'm overridding the "drawUnselectedText()" method in PlainView to do the coloring.
    Here's the code, you can see the call to SyntaxUtilities.paintSyntaxLine() which is JEdit's class to do the drawing.
             * Renders the given range in the model as normal unselected text. This
             * is implemented to paint colors based upon the token-to-color
             * translations. To reduce the number of calls to the Graphics object,
             * text is batched up until a color change is detected or the entire
             * requested range has been reached.
             * @param g
             *            the graphics context
             * @param x
             *            the starting X coordinate
             * @param y
             *            the starting Y coordinate
             * @param p0
             *            the beginning position in the model
             * @param p1
             *            the ending position in the model
             * @returns the location of the end of the range
             * @exception BadLocationException
             *                if the range is invalid
            protected int drawUnselectedText(Graphics g, int x, int y, int p0, int p1) throws BadLocationException {
                System.out.println("p0: " + p0 + " p1: " + p1 + " x: " + x + " y: " + y);
                // Get the start of the element
                int lineIndex = doc.getDefaultRootElement().getElementIndex(p0);
                // Get the element for the line
                Element elem = doc.getDefaultRootElement().getElement(lineIndex);
                System.out.println("lineIndex: " + lineIndex + " elemStartIDX: " + elem.getStartOffset() + " elemEndIDX: " + elem.getEndOffset());
                // Get the line text
                doc.getText(p0, p1 - p0, currentLineText);
                // If highlighting, mark the tokens
                if (marker != null) {
                    Token t = marker.markTokens(currentLineText, lineIndex);
                    x = SyntaxUtilities.paintSyntaxLine(currentLineText, t, styles, this, g, x, y, p0, p1);
                    System.out.println("Painted line at: " + x);
                } else {
                    // No highlighting requested, draw normal text
                    Font defaultFont = g.getFont();
                    Color defaultColor = styles[0].getColor(); // Default color of text
                    g.setFont(defaultFont);
                    g.setColor(defaultColor);
                    x = Utilities.drawTabbedText(currentLineText, x, y, g, this, p0);
                // Set the last line processed
                lastLine  = lineIndex;
                return x;
    Here is the code from the paintSyntaxLine() method:
         * Paints the specified line onto the graphics context. Note that this
         * method munges the offset and count values of the segment.
         * @param line
         *            The line segment
         * @param tokens
         *            The token list for the line
         * @param styles
         *            The syntax style list
         * @param expander
         *            The tab expander used to determine tab stops. May be null
         * @param gfx
         *            The graphics context
         * @param x
         *            The x co-ordinate
         * @param y
         *            The y co-ordinate
         * @return The x co-ordinate, plus the width of the painted string
        public static int paintSyntaxLine(Segment line, Token tokens, SyntaxStyle[] styles, TabExpander expander, Graphics gfx, int x, int y, int p0, int p1) {
            Font defaultFont = gfx.getFont();
            Color defaultColor = Color.black;
            FontMetrics fm = gfx.getFontMetrics(defaultFont);
            int offset = 0;
            while (tokens != null && tokens.id != Token.END) {
                int length = tokens.length;
                if (tokens.id == Token.NULL) {
                    if (!defaultColor.equals(gfx.getColor()))
                        gfx.setColor(defaultColor);
                    if (!defaultFont.equals(gfx.getFont()))
                        gfx.setFont(defaultFont);
                } else {
                    styles[tokens.id].setGraphicsFlags(gfx, defaultFont);
    //                fm = gfx.getFontMetrics();//[tokens.id].getStyledFont(defaultFont);
    //                FontMetrics dfm = Toolkit.getDefaultToolkit().getFontMetrics(defaultFont);
    //                System.out.println("Font Info: CharWidth[" + fm.charWidth(line.array[p1])+"], Max Advance[" + fm.getMaxAdvance()+"]");
    //                System.out.println("Default Font Info: CharWidth[" + dfm.charWidth(line.array[p1])+"], DMax Advance[" + dfm.getMaxAdvance()+"]");
    ////                x = fm.charsWidth(line.array, p0, length);
                line.count = length;
                x = Utilities.drawTabbedText(line, x, y, gfx, expander, p0);
                line.offset += length;
                offset += length;
                tokens = tokens.next;
            return x;
    I'm not sure what the problem is..i thought it might be an issue with the View and drawing multiple font styles. Since plain view only deals with a single font color and size. I tried using LabelView but that seems to need a StyledDocument and I had problems when I tried to use DefaultStyledDocument for my syntaxdocument. I was getting strange offset issues when using the Segment class.
    Here's what I posted: http://forum.java.sun.com/thread.jspa?threadID=780801
    I am using PlainDocument because that seemed to be what everyone was using for a syntax editor..since the structure of the document in a Plain Document is less complex.
    I orginally started out using the setCharacterAttributes() method on the DefaultStyledDocument and letting the views draw the text. That all seemed to work except for the "segment offset" issue. And I wasn't sure where the best spot to get the document to redraw subsequent lines in the case of changing a multiline comment, etc.
    So, everything I read about others attempts for syntax highlighters seems to use either StyledEditorKit with a fixed language set with custom parsing and using the setCharacterAttributes method. Or they use the plaindocument approach with a custom view..(which no one seems to share the source) or the project just simply uses the JEditTextArea directly (which we can't do in our product).
    We don't need multiple fonts per-line.. The document will always use one font face (Arial, Helvetica, etc) but may use different styles per word (bold, italic, etc).
    I thought I'd need to use FontMetrics to get the size of the font and such. But there didn't seem to be a difference in measurements based on the style of the font. (i.,e A bold font has the same charWidth('m') size as a regular style.
    At least that's what my test program showed..
    The other thing I noticed is that when the document is successfully colored and I use the mouse to select a region of text, the style of the text reverts back to normal. I'm sure that's because I only override the drawUnselectedText() method.
    Any ideas? Is there anyone who has successfully done this?
    Thanks,
    - Tim

    I just tried using a proportional font in my editor, and now I'm seeing your runaway-caret problem. Specifically, the caret remains in sync with the text as long as no bold characters are encountered, but it gets noticeably farther out of whack with each bold character it passes. I suspect that, when you measured the charWidth, your FontMetrics object wasn't really based on a bold font, because bold versions of proportional fonts are larger. And of course, the model/view conversion methods assume that the same style of the same font is used throughout the document. I've never had to deal with that problem, since I've always used monospaced fonts by preference, and bold versions of monospaced fonts really are the same size as the non-bold versions. I suggest you do the same, because getting this to work with proportional fonts look like a major hassle.

  • Syntax Highlighting for custom file extensions

    Hi everyone.
    I am currently working on a PHP project, and we are using
    *.thtml files for templates. The file isn't supported by
    Dreamweaver, as it's a fictional file extension. First I couldn't
    even open it with Dreamweaver, but after I added it in
    settings/file types, it worked.
    Now my question - how can I activate syntax highlighting for
    this filetype? It contains HTML and PHP, so it should work with the
    same highlighter as all the other file types do..
    Can someone help me out?
    Thanks.
    - Chris

    Got it
    http://alexle.net/archives/119

  • How to enable syntax highlighting for jspf files on Dreamweaver CS5.5 on Mac

    I ran into an issue where I couldn't get the color coding (color coding style) for java server pages fragments (.jspf) files to show syntax highliting.
    I followed the adobe instructions on Changing and adding file extensions recognized by Dreamweaver without any luck.
    Here is the solution that worked for me:
    On a Mac:
    1. Edit the /Users/YOUR USER/Library/Application Support/Adobe/Dreamweaver CS5.5/en_US/Configuration/DocumentTypes/MMDocumetTypes.xml
    Note: the Adobe instructions tell you to edit /Applications/Adobe Dreamweaver CS5.5/Configuration/DocumentTypes/MMDocumetTypes.xml (Editing this file didn't do anything for me, so you need to change the file above instead)
    Find,
    <documenttype id="JSP" servermodel="JSP" internaltype="Dynamic" winfileextension="jsp,jst" macfileextension="jsp,jst" file="Default.jsp" writebyteordermark="false" mimetype="text/html">
    Replace with,
    <documenttype id="JSP" servermodel="JSP" internaltype="Dynamic" winfileextension="jsp,jst,jspf" macfileextension="jsp,jst,jspf" file="Default.jsp" writebyteordermark="false" mimetype="text/html">
    2. Edit the /Users/YOUR USER/Library/Application Support/Adobe/Dreamweaver CS5.5/en_US/Configuration/Extensions.txt
    In the All: section on top add the jspf extention right after jsp in my example it looked like this
    HTM,HTML,SHTM,SHTML,HTA,HTC,XHTML,STM,SSI,JS,JSON,AS,ASC,ASR,XML,XSL,XSD,DTD,XSLT,RSS,RDF, LBI,DWT,ASP,ASA,ASPX,ASCX,ASMX,CONFIG,CS,CSS,CFM,CFML,CFC,TLD,TXT,PHP,PHP3,PHP4,PHP5,PHP-D IST,PHTML,JSP,WML,TPL,LASSO,JSF,VB,VBS,VTM,VTML,INC,SQL,JAVA,EDML,MASTER,INFO,INSTALL,THEME,CONFIG,MODU LE,PROFILE,ENGINE,SVG:All
    and I added the jspf and it looks like this now,
    HTM,HTML,SHTM,SHTML,HTA,HTC,XHTML,STM,SSI,JS,JSON,AS,ASC,ASR,XML,XSL,XSD,DTD,XSLT,RSS,RDF, LBI,DWT,ASP,ASA,ASPX,ASCX,ASMX,CONFIG,CS,CSS,CFM,CFML,CFC,TLD,TXT,PHP,PHP3,PHP4,PHP5,PHP-D IST,PHTML,JSP,JSPF,WML,TPL,LASSO,JSF,VB,VBS,VTM,VTML,INC,SQL,JAVA,EDML,MASTER,INFO,INSTALL,THEME,CONFIG,MODU LE,PROFILE,ENGINE,SVG:All
    That's it, Quit Dreamweaver and open it up again. Open the .jspf file and see the color coding (syntax highlighting)
    Hope this helps you and seves you time figuring it out. If this helped, do a good thing, next time you figure something out, tell others about it to save their time too, like I did. Enjoy.

    TheGrandNabib wrote:
    I don't seem to have a user Library folder, my only Library folder is on the same level as my Users folder.
    From Locating your personal configuration folder in the Dreamweaver FAQ:
    In Mac OS X (Lion and Mountain Lion), open Finder and press Shift-Cmd-Go. Type ~/Library/Application Support in the dialog box, and click Go. You should then be able to find the configuration folder.

  • Syntax highlighted program code in keynote?

    Is there any easy way insert programming code (in my case Ruby code) into a slide so it shows up with syntax highlighting and formating suitable for the code?
    I.E. so it looks like the highlighted code in Textmate or other gui editors?

    TextWrangler (and thus presumably BBEdit) do preserve their syntax colouring when PDFed, as does Taco HTML Edit. My guess is that this is capability is an app-by-app feature.
    If you were desperate for a PDF output to Keynote, you could always copy the text from Textmate and paste it into the freeware TextWrangler. You would likely have to adjust the default syntax colouring to match Textmate, but that would be relatively straightforward.

  • Enable syntax highlighting with configuration file in emacs

    When editing configuration files such as .procmailrc, .fetchmailrc, Emacs won't automatically highlight syntax for me.
    I can enable syntax highlighting in Vim by appending "syntax on"  to the .vimrc.
    I tried adding "global-font-lock-mode t" in the .emacs file, but it didn't solve my problem.
    What is the solution?

    igndenok wrote:
    Some of my config file have this (using conf-unix-mode)
    # this is .somerc
    # -*- conf-unix -*-
    Or using this in your .emacs
    (add-to-list 'auto-mode-alist '("\\.*rc$" . conf-unix-mode))
    I followed your advice, and it does have some syntax highlighting, but less than Vim does.
    For example, Vim will highlight all the names of colors in the .muttrc file, but Emacs doesn't.
    I guess Emacs is not as strong as Vim when it comes to editing configuration files.
    Last edited by yu3k (2011-09-14 10:06:47)

  • Lost syntax highlight in Vim after upgrade

    I don't know why, but Vim is not enabling syntax highlight anymore after the upgrade from 7.1.12-1 to 7.1.63-1. I've already searched in Vim's website and with ':help syntax.txt' but no luck. Any guesses?
    EDITED:
    I figured out part of the problem. I've always used the syntax 'vi filename' to open my files because I knew Vi had a link to Vim. But now it's not linking anymore. Opening files with 'vim filename' gives me the syntax highlight. So I guess the last upgrade had removed the link. Any chances to have it back?
    Last edited by alexmatos (2007-08-12 14:07:06)

    I had the same problem too, but the difference is, I always use vim, but after upgrading Arch I lost syntax highlight. After googling a lot and lurking @ vim sites I finally found the indirect answer here!
    I tried the opposite and use vi to open files but bash said vi not found, I did pacman -S vi, and pac said vi is up to date, upgrade? I decided not to believe vi and upgraded, everything's back now.
    So thank you for helping without knowing.

  • Query syntax highlighting lost when using national characters.

    Theres a minor bug with syntax highlighting. If I have a query in sqldeveloper like -
    select * from table
    where name = N'fred'
    and ... ... ...
    All the coloured syntax highlighting is lost from the N' onwards.
    Edited by: [email protected] on 24-Feb-2009 03:18

    Hi jonathanthomas,
    Since this issue is related to the web development,
    you could ask this question in the ASP.NET forum:
    http://forums.asp.net. If then, you could get
    an answer more quickly and professional. Thanks for your cooperation.
    Best Regards,
    Jack
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Syntax highlighting not working on PL/SQL developer tool

    Hello,
    Syntax highlighting is not working on PL/SQL developer tool using the beautifier. When I go set Syntax highlighting parameters (from  EDIT>PL/SQL Developer Beautifier Options > User Interface> Editor> Syntax Highlighting ) and click apply, the changes are not reflected in SQL code in the SQL window. Other feautures in the beautifier such as Fonts, Window types are working fine.
    Please help me with this issue.
    Thanks!!
    Shreejit

    As this is not an Oracle related question (let alone Oracle SQL or PL/SQL), and as you've been given a link to the relevant website... I'll now lock this thread.

  • [SOLVED] VIM: different syntax highlighting for new vs existing file

    I've had this minor nagging issue for a while that I've been trying to figure out, but I just don't know where to look.
    It is most obvious with LaTeX files (*.tex).  When I create a new file with "vim file.tex" it is recognized as a latex file and I get syntax highlighting, but it seems odd, or off.  When I close then reopen the same file, it gets "propper" syntax highlighting.
    I gather that this must be because of the two different mechanisms for matching the syntax type: filename versus content.  When the file is new, vim only uses the extension.  Once there is a latex comand (e.g., "\documentclass{article}") it recognizes it as something else and the highlighting style is different.
    It turns out just by actually elaborating exactly what the problem was, I was able to find the solution.  I looked for how vim recognizes the files, and found two relevant lines in /usr/share/vim/vim73/filetype.vim on lines 2093 and 2094.  Apparently the .tex filetype is not the same as .latex and others.  I changed it so it was, and I got the desired behavior.
    I thought about just not posting this - but it may be useful for others.

    You're right about it being overridden.  This change should be able to be placed in ~/.vimrc though.
    Well  that was foolish - I should have read the comments right below in that file.  It says exactly how to set it in vimrc.  I've now added the following to my ~/.vimrc and this is completely solved without modifying the /usr/... file.
    let g:tex_flavor = "tex"
    Last edited by Trilby (2013-03-29 16:11:26)

Maybe you are looking for

  • CS1, CS2, CS3 Animated Gif Creation Error.

    Example: http://img365.imageshack.us/img365/5665/walksz2.gif Whenever I made an animated gif with a transparent background, the above happens. It doesn't hide the previous frame when drawing the next one. However, when I give it a non-transparent bac

  • Why is ical 5.0.3 search inaccurate?

    For example, if I type in "Dad" then I get Dad events but a number of other events without the word dad.

  • How to study E-business suite?

    Hi all, I never studied Oracle any products. I want to study Oracle 11i e-business suite, but I don't know how to study it. Can you give me some suggestions and give me some documents for study? Thanks!

  • Attach excel file to the WI

    Good morning, How can I attach a file, in this case an Excel form, to the WI? Thank you very much for your suggestions, Ivson

  • Creative Cloud desktop greyed out and empty - no access

    After migrating from my iMac to an MacBook Pro I am unable to open creative cloud and any applications. I have done a uninstall and followed all the suggestions in the forums however my Creative Cloud desktop Icon is greyed out and is an empty screen