Skip to content

Commit

Permalink
restrict the addition of $[0[]0]
Browse files Browse the repository at this point in the history
  • Loading branch information
erinata committed Mar 17, 2012
1 parent abab1ae commit f358742
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
2 changes: 2 additions & 0 deletions Changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
changelog (for developer use only, include unreleased versions)

0.5.57.2
****** restrict the addition of $[0[]0] to snippet with no hotspot and it's inserted to a document with no hotspot following the insertion

0.5.57.1
****** Try to fix the final hotspot problem without an extra $[0[]0]
Expand Down
21 changes: 11 additions & 10 deletions PluginDefinition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3419,13 +3419,9 @@ bool replaceTag(char *expanded, int &posCurrent, int &posBeforeTag)
::SendScintilla(SCI_REPLACETARGET, strlen(expanded_eolfix), reinterpret_cast<LPARAM>(expanded_eolfix));

delete [] expanded_eolfix;

::SendScintilla(SCI_GOTOPOS,posBeforeTag,0);

//alert(g_stopCharArray);


int stopFound = searchNext(g_stopCharArray);
//int stopFound = -1;
//alert(g_stopCharArray);

::SendScintilla(SCI_GOTOPOS,posBeforeTag,0);
searchNext("`[SnippetInserting]");
Expand All @@ -3451,14 +3447,19 @@ bool replaceTag(char *expanded, int &posCurrent, int &posBeforeTag)
int posEndOfSnippet = ::SendScintilla(SCI_GETCURRENTPOS,0,0);

::SendScintilla(SCI_SETSELECTION,posEndOfSnippet,posEndOfInsertedText);
::SendScintilla(SCI_REPLACESEL, 0, (LPARAM)"");

if (stopFound<0)
::SendScintilla(SCI_GOTOPOS,posBeforeTag,0);
//int stopFound = searchNext(g_stopCharArray);
int stopFound = searchNext("\\$\\[.\\[",true);
//int stopFound = -1;

if (stopFound<posBeforeTag)
{
::SendScintilla(SCI_GOTOPOS,posEndOfSnippet,0);
::SendScintilla(SCI_REPLACESEL, 0, (LPARAM)g_stopCharArray);
} else
{
::SendScintilla(SCI_REPLACESEL, 0, (LPARAM)"");
}


//delete [] g_stopCharArray;

Expand Down
2 changes: 1 addition & 1 deletion README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ those files are included in the source.
DuckEval and sqlite3 have their own licenses. The licenses are included in the
source.

FingerText version 0.5.49 (excluding the parts mentioned above) is released
FingerText version 0.5.56 (excluding the parts mentioned above) is released
under MIT license.

MIT license
Expand Down

0 comments on commit f358742

Please sign in to comment.