Skip to content

Commit

Permalink
addons: further improve RFC 3986 compliancy for URI selection
Browse files Browse the repository at this point in the history
  • Loading branch information
glitsj16 committed Jun 22, 2015
1 parent a2fd9d6 commit 58f9216
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion addons/src/ao_openuri.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ void ao_open_uri_update_menu(AoOpenUri *openuri, GeanyDocument *doc, gint pos)
sci_get_selected_text(doc->editor->sci, text);
}
else
text = editor_get_word_at_pos(doc->editor, pos, GEANY_WORDCHARS"@.://-?&%#=~+");
text = editor_get_word_at_pos(doc->editor, pos, GEANY_WORDCHARS"@.://-?&%#=~+_&,;");

/* TODO be more restrictive when handling selections as there are too many hits by now */
if (text != NULL && (ao_uri_has_scheme(text) || ao_uri_is_link(text)))
Expand Down

7 comments on commit 58f9216

@glitsj16
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Further enhancements added to Open/Copy URI word selection. Based on http://tools.ietf.org/html/rfc3986#section-2

@b4n
Copy link
Member

@b4n b4n commented on 58f9216 Jun 22, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

& is there twice

@b4n
Copy link
Member

@b4n b4n commented on 58f9216 Jun 22, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_ is in GEANY_WORDCHARS (but it's not a problem to have it twice I guess)

@glitsj16
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirming the doubled entree for "&", which is fixed now. Regarding the "_" (underscore), maybe there was a mix-up with the "-" (single dash)? I can only see one of each in GEANY_WORDCHARS.

@b4n
Copy link
Member

@b4n b4n commented on 58f9216 Jun 25, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@glitsj16 I mean that _ is in GEANY_WORDCHARS but you also added it (after +), so it's actually there twice in the resulting string.

@frlan
Copy link
Member

@frlan frlan commented on 58f9216 Jun 25, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's try it out in praxis. We can adjust them if it's not working well.

@glitsj16
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the late reply. Tested today and indeed, the double "_" is superfluous, so I took it out. Things seem to be pretty fool-proof now (self-reference). Thanks again for all your patience.

Please sign in to comment.