[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kwrite-devel
Subject:    kate syntax highlighting / folding+ questions
From:       Randy Kramer <rhkramer () gmail ! com>
Date:       2014-10-15 20:19:36
Message-ID: 201410151619.36056.rhkramer () gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Irrelevant background: Now that bug 112888 is fixed, and I've installed 
Debian wheezy on a system (with kde 4.8.4) and foresee upgrading to 
Debian testing or jessie in the very near future (with kde 4.14.4, which 
is greater than the version of kde 4.11.n for which the fix for bug 
112888 is  incorporated, I am back to working on the kate version of 
my attempt at an askSam workalike.

But, I probably have to change some of my markup, and want to ask a 
few questions:

   * Back when I worked with kate highlighting before, there was no 
good way to detect multiline markups.  To be more specific, I'd like to 
be able to distinguish between a ' at the beginning of a line versus a ' 
at the beginning of a line after a blank line--as a regex in some other 
regex version, I'd use \n' versus \n\n', but I don't think I can do that in 
katepart, can I?  I mean, I've used regexs that start with a ^, but I 
don't think two in a row ^^ will detect / confirm a blank line?  (I could / 
should try this, but I've worked through several other problems today, 
and I want to be lazy.)

   * In most of what I've done in the older kate versions, I've tried to 
avoid RegExpr and use StringDetect instead, using "column=0" to 
detect markup at the beginning of a line.  I have two related 
questions:

      * Is there a way, using StringDetect, to detect that there is 
nothing else on that same line--for example, a ' as the only thing on a 
line?  As a regex in kate I believe I could do ^'$

      * Actually, following up on the last question, I want to treat ' as 
proper markup in either of two cases, either it is the only thing on a 
line, or it is at the start of a line followed by a space and then 
anything else is allowed on the line.  One way I could do that is with 
two StringDetect lines, one detecting "'" at column 0, and one 
detecting "' " at column 0--is there any better way?

Thanks!
Randy Kramer


[Attachment #5 (text/html)]

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" \
"http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" \
content="1" /><style type="text/css"> p, li { white-space: pre-wrap; }
</style></head><body style=" font-family:'DejaVu Sans'; font-size:9pt; \
font-weight:400; font-style:normal;"> <p style=" margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;">Irrelevant background: Now that bug 112888 is fixed, and I've \
installed Debian wheezy on a system (with kde 4.8.4) and foresee upgrading to Debian \
testing or jessie in the very near future (with kde 4.14.4, which is greater than the \
version of kde 4.11.n for which the fix for bug 112888 is  incorporated, I am back to \
working on the kate version of my attempt at an askSam workalike.</p> <p \
style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; \
margin-right:0px; -qt-block-indent:0; text-indent:0px; ">&nbsp;</p> <p style=" \
margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;">But, I probably have to \
change some of my markup, and want to ask a few questions:</p> <p \
style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; \
margin-right:0px; -qt-block-indent:0; text-indent:0px; ">&nbsp;</p> <p style=" \
margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;">   * Back when I worked with \
kate highlighting before, there was no good way to detect multiline markups.  To be \
more specific, I'd like to be able to distinguish between a ' at the beginning of a \
line versus a ' at the beginning of a line after a blank line--as a regex in some \
other regex version, I'd use \n' versus \n\n', but I don't think I can do that in \
katepart, can I?  I mean, I've used regexs that start with a ^, but I don't think two \
in a row ^^ will detect / confirm a blank line?  (I could / should try this, but I've \
worked through several other problems today, and I want to be lazy.)</p> <p \
style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; \
margin-right:0px; -qt-block-indent:0; text-indent:0px; ">&nbsp;</p> <p style=" \
margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;">   * In most of what I've \
done in the older kate versions, I've tried to avoid RegExpr and use StringDetect \
instead, using &quot;column=0&quot; to detect markup at the beginning of a line.  I \
have two related questions:</p> <p style="-qt-paragraph-type:empty; margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px; ">&nbsp;</p> <p style=" margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;">      * Is there a way, using StringDetect, to detect that there \
is nothing else on that same line--for example, a ' as the only thing on a line?  As \
a regex in kate I believe I could do ^'$</p> <p style="-qt-paragraph-type:empty; \
margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px; ">&nbsp;</p> <p style=" margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px; -qt-user-state:0;">      * Actually, following up on the last \
question, I want to treat ' as proper markup in either of two cases, either it is the \
only thing on a line, or it is at the start of a line followed by a space and then \
anything else is allowed on the line.  One way I could do that is with two \
StringDetect lines, one detecting &quot;'&quot; at column 0, and one detecting \
&quot;' &quot; at column 0--is there any better way?</p> <p \
style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; \
margin-right:0px; -qt-block-indent:0; text-indent:0px; ">&nbsp;</p> <p style=" \
margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Thanks!</p> <p style=" \
margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Randy Kramer</p> <p \
style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; \
margin-right:0px; -qt-block-indent:0; text-indent:0px; ">&nbsp;</p> <p \
style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; \
margin-right:0px; -qt-block-indent:0; text-indent:0px; ">&nbsp;</p></body></html>



_______________________________________________
KWrite-Devel mailing list
KWrite-Devel@kde.org
https://mail.kde.org/mailman/listinfo/kwrite-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic