Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

32
LINES

< > BotCompany Repo | #1035118 // RSyntaxTextArea Squiggly Line Spike [OK]

JavaX source code (desktop) [tags: use-pretranspiled] - run with: x30.jar

Download Jar. Uses 1485K of libraries. Click here for Pure Java version (16430L/98K).

!7

delegate AbstractParser, ParseResult, DefaultParseResult,
  DefaultParserNotice
  to org.fife.ui.rsyntaxtextarea.parser.
  
import org.fife.ui.rsyntaxtextarea.RSyntaxDocument;

sclass MyParser extends AbstractParser {
  @Override
  public ParseResult parse(RSyntaxDocument doc, String style) ctex {
    print("Parsing");
    var result = new DefaultParseResult(this);
    S text = doc.getText(0, doc.getLength());
    print(+text);
    S firstLine = firstLine(text);
    if (l(firstLine) > 1)
      result.addNotice(new DefaultParserNotice(this, "What?", 0, 0, l(firstLine)-1));
    ret result;
  }
}

p-exp {
  RSyntaxTextAreaWithSearch ta = rSyntaxTextAreaWithSearch();
  ta.menuLessOperation();
  new MyParser parser;
  ta.textArea().addParser(parser);
  
  // You can also call ta.textArea().forceReparsing(parser);
  
  showFrame(ta);
}

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

-
Snippet ID: #1035118
Snippet name: RSyntaxTextArea Squiggly Line Spike [OK]
Eternal ID of this version: #1035118/15
Text MD5: 4e86dc9bb3fbb6c3f6c2ec2967f0dcc1
Transpilation MD5: 612a1bc6c6bda42d39be258399c9e3d0
Author: stefan
Category: javax
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-03-30 17:07:30
Source code size: 876 bytes / 32 lines
Pitched / IR pitched: No / No
Views / Downloads: 264 / 968
Version history: 14 change(s)
Referenced in: