Skip to content

Commit

Permalink
Release v1.7
Browse files Browse the repository at this point in the history
  • Loading branch information
jShiwaniGupta committed Sep 26, 2024
1 parent 1db29d2 commit 260a9f6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>io.github.jeddict</groupId>
<artifactId>jeddict-ai</artifactId>
<version>1.6</version>
<version>1.7</version>
<packaging>nbm</packaging>
<name>Jeddict AI Assistant</name>
<description>Jeddict AI Assistant is a powerful and intuitive plugin designed for Apache NetBeans IDE.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,12 +276,18 @@ private JeddictItem createItem(Snippet varName, String line, String lineTextBefo
// Handle line and snippet first words safely
String firstWordLine = "";
if (lineTextBeforeCaret != null && !lineTextBeforeCaret.trim().isEmpty()) {
firstWordLine = lineTextBeforeCaret.trim().split("[^a-zA-Z0-9]+")[0]; // Split by any non-alphanumeric character
String[] textSegments = lineTextBeforeCaret.trim().split("[^a-zA-Z0-9]+");
if(textSegments.length > 0) {
firstWordLine = textSegments[0]; // Split by any non-alphanumeric character
}
}

String firstWordSnippet = "";
if (varName.getSnippet() != null && !varName.getSnippet().trim().isEmpty()) {
firstWordSnippet = varName.getSnippet().trim().split("[^a-zA-Z0-9]+")[0]; // Split by any non-alphanumeric character
String[] textSegments = varName.getSnippet().trim().split("[^a-zA-Z0-9]+");
if(textSegments.length > 0) {
firstWordSnippet = textSegments[0]; // Split by any non-alphanumeric character
}
}

if (firstWordLine.equalsIgnoreCase(firstWordSnippet)) {
Expand Down

0 comments on commit 260a9f6

Please sign in to comment.