Rev 23 | Rev 29 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 23 | Rev 25 | ||
---|---|---|---|
Line 2... | Line 2... | ||
2 | 2 | ||
3 | interface |
3 | interface |
4 | 4 | ||
5 | uses |
5 | uses |
6 | Windows, Messages, SysUtils, StrUtils, IniFiles, Classes, Forms, Variants, MsHTML, |
6 | Windows, Messages, SysUtils, StrUtils, IniFiles, Classes, Forms, Variants, MsHTML, |
7 | SHDocVw_TLB, StdCtrls, SynEdit, ActiveX; |
7 | StdCtrls, SynEdit, ActiveX; |
8 | 8 | ||
9 | function GetDosOutput(CommandLine: string; Work: string = ''): string; |
9 | function GetDosOutput(CommandLine: string; Work: string = ''): string; |
10 | function StrIPos(const SubStr, S: string): Integer; |
10 | function StrIPos(const SubStr, S: string): Integer; |
11 | function LoadFileToStr(const FileName: TFileName): AnsiString; |
11 | function LoadFileToStr(const FileName: TFileName): AnsiString; |
12 | function LastPos(const SubStr, S: string): integer; |
12 | function LastPos(const SubStr, S: string): integer; |
Line 161... | Line 161... | ||
161 | // Template: http://stackoverflow.com/questions/6339446/delphi-get-the-whole-word-where-the-caret-is-in-a-memo |
161 | // Template: http://stackoverflow.com/questions/6339446/delphi-get-the-whole-word-where-the-caret-is-in-a-memo |
162 | function GetWordUnderPos(AMemo: TSynEdit; Line, Column: integer): string; |
162 | function GetWordUnderPos(AMemo: TSynEdit; Line, Column: integer): string; |
163 | 163 | ||
164 | function ValidChar(c: char): boolean; |
164 | function ValidChar(c: char): boolean; |
165 | begin |
165 | begin |
- | 166 | {$IFDEF UNICODE} |
|
166 | result := CharInSet(c, ['a'..'z', 'A'..'Z', '0'..'9', '_']); |
167 | result := CharInSet(c, ['a'..'z', 'A'..'Z', '0'..'9', '_']); |
- | 168 | {$ELSE} |
|
- | 169 | result := c in ['a'..'z', 'A'..'Z', '0'..'9', '_']; |
|
- | 170 | {$ENDIF} |
|
167 | end; |
171 | end; |
168 | 172 | ||
169 | var |
173 | var |
170 | LineText: string; |
174 | LineText: string; |
171 | InitPos : Integer; |
175 | InitPos : Integer; |
Line 175... | Line 179... | ||
175 | if AMemo.Lines.Count-1 < Line then Exit; |
179 | if AMemo.Lines.Count-1 < Line then Exit; |
176 | 180 | ||
177 | //Get the text of the line |
181 | //Get the text of the line |
178 | LineText := AMemo.Lines[Line]; |
182 | LineText := AMemo.Lines[Line]; |
179 | 183 | ||
180 | if LineText = '' then exit(''); |
184 | if LineText = '' then |
- | 185 | begin |
|
- | 186 | result := ''; |
|
- | 187 | exit; |
|
- | 188 | end; |
|
181 | 189 | ||
182 | // Column zeigt auf das Zeichen LINKS vom Cursor! |
190 | // Column zeigt auf das Zeichen LINKS vom Cursor! |
183 | 191 | ||
184 | InitPos := Column; |
192 | InitPos := Column; |
185 | if not ValidChar(LineText[InitPos]) then Inc(InitPos); |
193 | if not ValidChar(LineText[InitPos]) then Inc(InitPos); |
Line 247... | Line 255... | ||
247 | // TODO: This code is not very reliable. At MAC OSX, the file system HFS can be switched |
255 | // TODO: This code is not very reliable. At MAC OSX, the file system HFS can be switched |
248 | // between case sensitivity and insensitivity. |
256 | // between case sensitivity and insensitivity. |
249 | {$IFDEF LINUX} |
257 | {$IFDEF LINUX} |
250 | exit(true); |
258 | exit(true); |
251 | {$ELSE} |
259 | {$ELSE} |
252 | exit(false); |
260 | result := false; |
- | 261 | exit; |
|
253 | {$ENDIF} |
262 | {$ENDIF} |
254 | end; |
263 | end; |
255 | 264 | ||
256 | end. |
265 | end. |