Search found 83 matches
- 22 Aug 2011 14:05
- Forum: Syntax files
- Topic: Tcl and Code Folding
- Replies: 7
- Views: 17680
Re: Tcl and Code Folding
Here's one more snippet of valid code that might impact which of the above two methods makes the most sense... proc buildUI {parent {name "Test"} {root .}} { ... ... } So, within a procedure's argument list, *optional* arguments with default values can be defined by enclosing them in brace...
- 21 Aug 2011 18:52
- Forum: Syntax files
- Topic: Tcl and Keyword Highlighting
- Replies: 1
- Views: 9711
Tcl and Keyword Highlighting
I'm creating a Tcl/Tk syntax file and I've run into a highlight issue I don't understand. Here's an example: First, I've defined the word "message" as a keyword, which generally works as expected. However, I've noticed that the string "message" is also colorized as a keyword in t...
- 20 Aug 2011 22:47
- Forum: Scripts
- Topic: GetMethodAtCursor
- Replies: 3
- Views: 15794
Re: GetMethodAtCursor
Here's what's happening with the selection, assuming the insertion cursor is somewhere within the body of a method: - All lines are selected between the line *containing* the insertion cursor and the end of the method - The first line of the method is selected All lines that are *above* the insertio...
- 20 Aug 2011 20:20
- Forum: Syntax files
- Topic: Tcl and Code Folding
- Replies: 7
- Views: 17680
Re: Tcl and Code Folding
Not without adding some kind of fold option. To make it work is it safe to: 1. Always ignore { ... } on the same line? 2. Or assume the last { on the same line (or first on the next) is the beginning of a fold? I *think* either of those sound OK. In my original screenshot above, take a look at line...
- 20 Aug 2011 17:39
- Forum: Syntax files
- Topic: Tcl and Code Folding
- Replies: 7
- Views: 17680
Re: Tcl and Code Folding
Richard, I've played with your suggested folding rules. They're definitely on the right track, though they suffer from something I noticed while playing with the "\in" item last night. That is, since the folding stops just *above* the line with a matching or less indent, the closing brace ...
- 20 Aug 2011 17:10
- Forum: Syntax files
- Topic: Tcl and Code Folding
- Replies: 7
- Views: 17680
Re: Tcl and Code Folding
Yeah, that's the problem I ran into, but I figured there might be a way around it that I was unaware of...Rickard Johansson wrote:It's difficult because {} is used to enclose conditions, parameters...
Thanks, I'll give your suggestions a try.Rickard Johansson wrote:But maybe something like this:
Jeff
- 20 Aug 2011 17:07
- Forum: Scripts
- Topic: GetMethodAtCursor
- Replies: 3
- Views: 15794
GetMethodAtCursor
I'm attempting to write a script that will select the entire method that contains insertion cursor. Looking at the scripting docs, GetMethodAtCursor(True) sounds like exactly what I need. However, using that, the lines that get selected seem to depend on where the cursor is in the method. For instan...
- 20 Aug 2011 04:49
- Forum: Syntax files
- Topic: Tcl and Code Folding
- Replies: 7
- Views: 17680
Tcl and Code Folding
Hello, I just started working on a Tcl syntax file, but I'm struggling a bit with the code folding. First, here's some sample code: proc resolveMacros {string} { set serial [file tail $::globals(serialDir)] if {$serial eq ""} {set serial "Undefined"} set part [file tail $::global...