📄 syntaxutilities.java
字号:
/* * SyntaxUtilities.java - Utility functions * :tabSize=8:indentSize=8:noTabs=false: * :folding=explicit:collapseFolds=1: * * Copyright (C) 2003 Slava Pestov * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */package org.gjt.sp.jedit.syntax;import javax.swing.text.Segment;/** * Contains utility functions used by the syntax highlighting code. * @since jEdit 4.2pre1 * @version $Id: SyntaxUtilities.java,v 1.1 2003/04/28 01:35:28 spestov Exp $ * @author Slava Pestov */public class SyntaxUtilities{ //{{{ regionMatches() method /** * Checks if a subregion of a <code>Segment</code> is equal to a * character array. * @param ignoreCase True if case should be ignored, false otherwise * @param text The segment * @param offset The offset into the segment * @param match The character array to match * @since jEdit 4.2pre1 */ public static boolean regionMatches(boolean ignoreCase, Segment text, int offset, char[] match) { int length = offset + match.length; if(length > text.offset + text.count) return false; char[] textArray = text.array; for(int i = offset, j = 0; i < length; i++, j++) { char c1 = textArray[i]; char c2 = match[j]; if(ignoreCase) { c1 = Character.toUpperCase(c1); c2 = Character.toUpperCase(c2); } if(c1 != c2) return false; } return true; } //}}}}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -