Skip to content

Commit 2575533

Browse files
author
Zachary Norman
committed
Additional logic check for if we are the start of the string or not
1 parent 7949d50 commit 2575533

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

htmlizer__define.pro

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,7 @@ pro htmlizer::ProcessString, text, $
788788
if (i eq 0) then begin
789789
;we made it this far, check if we are in parenthesis or not
790790
;if we are, we are not the start of the string, i.e. (this.that()).method,
791-
posParen = stregex(text, '\(([^)]+)\)', LENGTH = lParen)
791+
posParen = stregex(str_orig, '\(([^)]+)\)', LENGTH = lParen)
792792

793793
;set our start flag accordingly
794794
case (1) of
@@ -851,7 +851,7 @@ pro htmlizer::ProcessString, text, $
851851
if (i eq 0) then begin
852852
;we made it this far, check if we are in parenthesis or not
853853
;if we are, we are not the start of the string, i.e. (this.that()).method,
854-
posParen = stregex(text, '\(([^)]+)\)', LENGTH = lParen)
854+
posParen = stregex(str_orig, '\(([^)]+)\)', LENGTH = lParen)
855855

856856
;set our start flag accordingly
857857
case (1) of
@@ -1680,15 +1680,21 @@ function HTMLizer::HTMLize, textArr,$
16801680
str_orig = ''
16811681
endelse
16821682

1683+
;initialize our flag for the strings start
1684+
;we can have syntax of the form (someFunc()).proMethod which
1685+
;should still include .proMethod as a method to check
1686+
start_flag = 1
1687+
16831688
;iterate over each good portion of the line
16841689
foreach subStr, strings, j do begin
1690+
;make sure we can process our substring
16851691
if (process[j]) then begin
16861692
;add color to the string
16871693
self.processString, subStr, $
16881694
CONTINUATION = continuation,$
16891695
TOOLTIPS = tooltips,$
16901696
DOCS_LINKS = docs_links,$
1691-
STRING_START = j eq 0,$
1697+
STRING_START = start_flag,$
16921698
IDL_CONSOLE = idl_console,$
16931699
STR_ORIG = str_orig
16941700

@@ -1835,7 +1841,6 @@ inputFile = file_which('python__define.pro')
18351841

18361842
;read in plot.pro
18371843
strings = htmlizer_read_file(inputFile)
1838-
strings = '(it->expects())->toFindInArray, scalar'
18391844

18401845
;initialize the object
18411846
html = htmlizer()

0 commit comments

Comments
 (0)