erinata / FingerText

Tab triggered snippet plugin for Notepad++.
https://sourceforge.net/projects/fingertext/
146 stars 32 forks source link

"surrounded with" replace the "selection text" #42

Open simongcc opened 11 years ago

simongcc commented 11 years ago

I tried the step describing in https://github.com/erinata/FingerText/wiki/Surrounded-with-functionality

to wrap a text with an anchor tag.

eg. I am creating a HTML link: My original text is "Going to another place" when select this text -> open SnippetDock -> select insert -> double click the "a" tag "Going to another place" is being replaced instead of being "wrapped"

replaced with "$[![{text}]!]" instead of expected result

I tried

tag also without hotspot, but the result is same.

Am I overlooked some settings or is it a bug/current limitation?

System information: Windows 8 Notepad++ 6.3 Fingertext 0.5.6.0 Alpha

Many thanks.

dail8859 commented 11 years ago

According to the wiki's main page, this is for version 0.6.0. So the wiki may not apply to 0.5.6.0. If you are wanting documentation specifically for your version, I believe the current readme is the document to reference.

simongcc commented 11 years ago

Thanks for your information.

I have an idea, see if it is feasible to work on.

The flow for my situation to discover the "Surrounded With":

  1. I downloaded the Fingertext based on other recommendation
  2. try it on NPP
  3. try to wrap something and add tag
  4. found it is replacing my text
  5. search for solution in Google with keywords like "wrap text fingertext"
  6. "Surrounded With" wiki page come out and I intuitively go to see.

Until step 6, I didn't notice that there is 0.6.0 exist because it is not yet released. If I am not going to the top page of Wiki. I will simply not get notified.

I am not sure if other people will encounter the same, if so, it might be good to add something like: "Surrounded With" feature is available in the up coming 0.6 or just 0.6 with the link pointing to the top of wiki. It might avoid problem or question raised. Just suggesting based on user experience.

Although I am not a programming folks, I am a Frontend developer, If I can contribute anything, let me know. Thanks a lot for the great work.

erinata commented 11 years ago

Thanks dail8859's explanation. It's true that the wiki is for 0.6.0 which is unreleased. However, the $[![(key)SELECTION]!] functionality is implemented already in 0.5.6 so what simongcc saw is actually a bug. I will look into the issue.

erinata commented 11 years ago

Notice that you need to make your own snippet in order to make the "warp around" happen. If you need an "a tag" with warp around, the snippet you need is

<a>$[![(key)SELECTION]!]$[![]!]</a>

If that doesn't work, then there is bug in fingertext (even in 0.5.6) and I need to fix it.

simongcc commented 11 years ago

I have tried your suggestion and it works. I can manage to workaround for some of the tags needed first.

BTW, I found that if I type "comment" with Insertion Dialogue, according to description, it will use the first come up. Then if I select the comment (eg. js) and press TAB, it still use HTML comment instead. Is it a feature that will be updated in 0.6 too? should I open another issue for discussion? (I suppose, according to your design, if more than 1 "comment", I can choose the one that I would like to apply.) The current workaround for me is using different "tag name", eg "hcomment" for html comment.

Still, many thanks for your hard work and inspiring tools. Take your time.