Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

FingerText (A new snippet plugin)

erinata
2011-01-15
2013-09-09
<< < 1 2 3 4 .. 7 > >> (Page 2 of 7)
  • Don HO
    Don HO
    2011-01-22

    Quite amazing!
    It's shame that it's based on file extension but not on document set language.
    You can use NPPM_GETBUFFERLANGTYPE and NPPN_LANGCHANGED to get current language and detect the change of language.
    Otherwise, the font size is too big under my Windows 7 :

    Could they be fixed?

    Otherwise, It's a very promising plugin.

    Don

     
  • erinata
    erinata
    2011-01-22

    Thanks Don.

    Currently I am hardcoding the size =P But later I should have a config file so that you can set the size…..
    I wonder if I can make it use the font size of the current editor though……didn't see a notepad++ notification for that.

    I think I use file name and ext name for good reasons. But I think I will cater both Language specific and file name specific snippets in the future. (yeah I implemented that on a branch already, but I want to find a way so that different snippet scopes work well with each others before I merge that in)

    notepad++ rocks!!!

     
  • erinata
    erinata
    2011-01-22

    I do not want to bombard the forum with update messages but FingerText 0.4.4 is released.

    https://github.com/erinata/FingerText

    github.com/downloads/erinata/FingerText/FingerText%20-%200.4.4.zip

    https://sourceforge.net/projects/fingertext/

    I moved the database to the config folder and it should solve the windows 7 or vista admin right problem. Also there is a new import and export function so that you can backup your whole data base and share it will others.

    The plugin doesn't ship with the db3 file now, it is created when you first launch FingerText with notepad++. Basically you do not need to worry about database anymore. All the database related thing will be in the background. Enjoy creating, managing and exporting snippets all under the notepad++ interface.

    Hi Dave, the plugin doesn't ship the db3 file with it now but I still want the user to have a copy of SampleSnippet.ftd (which is in the zip file package)  so that they can import them if they wish to use it. Is that supported by Plugin Manager?

     
  • kRs
    kRs
    2011-01-24

    2011-01-22 12:30:07 GMT
    I do not want to bombard the forum with update messages

    You have to :)
    They are always very welcome and appreciated ^^

    Thanks for developing this plugin.. as you have seen it has been very appreciated by Dave, Don.. and there are good reasons..

    regards,
    Francesco

     
  • erinata
    erinata
    2011-01-27

    Thanks kkrs, thanks for your encouragement.

    Here is FingerText 0.4.11. There are tons of changes and improvements….

    - Snippets TriggerText and Scope are NOT case sensitive now. Extension .c and .C are viewed as the same extension,and TriggerText "NpP" is the same as "nPp"
    - Totally new snippet editing view with more wrong format checking
    - Change double click behaviour in SnippetDock. It trigger editview instead of inserting snippets.
    - Use ctrl-S to save snippet while in editing view
    - Added an "About" and "Quick Guide" command in menu
    - Added a command to temporarily enable or disable fingertext
    - Added a command to toggle show/Hide SnippetDock
    - Added a snippet Preview Box (chinese snippet text not supported)
    - Snippets function are disabled when you are editing snippets
    - save button disabled when the editor is not editing snippet
    - More instructions on the snippetdock
    - And many other fix…….see github page for more details.

    GitHub:
    http://github.com/erinata/FingerText
    http://github.com/downloads/erinata/FingerText/FingerText%20-%200.4.11.zip
    SourceForge
    https://sourceforge.net/projects/fingertext/

     
  • bbluemel
    bbluemel
    2011-01-28

    Awesome plugin.  Can I make a suggestion? Take note of the indentation of where the cursor is and use that as the base indentation.
    e.g. I have a CFML snippet of

    <cfquery datasource="$[![#dsn_name#]!]" name="$[![queryname]!]">
        $[![Query]!]
    </cfquery>
    <cfoutput query="$[![queryname]!]">
        $[![]!]
    </cfoutput>
    

    However if I'm indented-in, it will come out like this:

        <cfquery datasource="#dsn_name#" name="$[![queryname]!]">
        $[![Query]!]
    </cfquery>
    <cfoutput query="$[![queryname]!]">
        $[![]!]
    </cfoutput>
    

    whereas I would expect it to be:

        <cfquery datasource="#dsn_name#" name="$[![queryname]!]">
            $[![Query]!]
        </cfquery>
        <cfoutput query="$[![queryname]!]">
            $[![]!]
        </cfoutput>
    

    Also a slight bug, when I highlighted the code to indent it to move across, it kept on jumping to the first hotspot in the selection, maybe if a highlighted area covers more than one line then send the tab off to scintilla?

    Other than that so far I love it :)  And will definitely be promoting its use with my ColdFusion plugin in the near future.

     
  • erinata
    erinata
    2011-01-28

    Thanks for your suggestion!

    Actually I have been trying to implement this "indentation base reference" thing last week but I don't know why I cannot get it work properly..>_<……that's probably a good feature to have.

    For second point, I want to allow for multi-line hotspot text (remember the hotspot text also serve as "default value" so I want to allow it to be multi line text)  so I cannot send a tab base on "highlight over more than one line"

    However, I do check whether the selection is a rectangular one or not. Therefore, to indent your code without being disturbed by the hotspots, you can go to the beginning of the line, hold Alt+shift+down arrow to select multiple lines, and hit tab to indent.

    Another option (which is not as good) is to temporarily disable FingerText, in the lastest version (0.4.11) I add a toggle command to toggle on/off FingerText. Hook it to a hot key and you can disable the fingertext function when you try to indent your code.

     
  • erinata
    erinata
    2011-01-28

    Hi bbluemel,

    Here I merged the branch  of code that have the functionality of "indentation reference". The code doesn't smell good and I still feel that it may not work properly……(That's why I didn't merge that into official release). If you really like the indentation reference function, would you mind testing this out and see if it deliver what you expect?

    https://github.com/downloads/erinata/FingerText/FingerText%20-%200.4.13(unstable).zip

    To All,
    This is not really a official release. If you just want to use FingerText you can download the latest version 0.4.11.
    But if you are curious. You can try the 0.4.13 out too. It also features live search of snippet in the snippetdock as you are typing in your document.

     
  • First of all: great plugin - I like it very much …

    I accidently added a new snippet for the extension *.pl instead for pl only. Now this new snippet never occurs - unless it should be stored in the database …
    How can I get rid of this incidental snippet from database?

    Feature Requests/WishList:
    * A better editing facility for complete snippet database would be helpful. It would be good, if one could edit all the snippets without having a file for a certain language opened - something like "Show all available snippets" would eventually be sufficient . I tried to open the ftd-Database (which is proclaimed to be a sqlite-Database) with a SQLite database editor, but failed since the database seems to be encrypted (at least this is said by database editor) … :-(

    * The possibilty of using "system variables" within snippets would be helpful: snippets like "today is " or "You are currently using " would be possible
    * The use of "snippets within snippets" would be helpful: a snippet like AUTHOR could be used within other snippets

     
  • Feature Requests/WishList continued:

    * Resizing the FingerText sidebar should resize the textboxes within the sidebar as well ("Snippet preview", "List of all available snippets" …)
    * Use the full size of the FingerText sidebar

     
  • Sorry - forgot one …
    Feature Requests/WishList continued:

    * Multiple file extensions for snippets (for example:  .cpp;.hpp;.cxx.;hxx) - or even better: possibilty to use Notepad's native supported languages

     
  • erinata
    erinata
    2011-01-28

    Thank jbkilian, let me answer these one by one………………………

    1. If you update to 0.4.11, all the snippet are show when you are in the edit view, (that's a problem in 0.4.4).  So you can delete the accidentally added snippet there.

    2. Notice that if you want a snippet for extension pl only , you should have ".pl" (without quotes) in the scope part instead of just "pl".

    3. The editing environment is largely improved in 0.4.11, I will continue to improve that.

    4. The whole purpose is you do not need to edit the sqlite database yourself and you can do everything in the notepad++ interface……..but I really didn't do anything to encrypt the database….

    5. Dynamic hotspots function is COMING!!!!!  It will be a LOT more than just  . (FingerText will go to 0.5.0 when I can finally deliver this Dynamic hotspots function

    6. What you mean by snippet in snippet? you can definitely "chain snippet" as you can trigger one snippet containing hotspot  $[!!]  and press "left arrow" and tab when you are at that hotspot to trigger another snippet called AUTHOR. Is that what you need? Or I misunderstood?

    7. I don't know how to resize the textbox =_____=…….Ok let me investigate it later.

    8. Multiple extensions snippet……Yes……..It's in the plan after Don point that out. What I have in mind is you can group several group of scopes together.

     
  • bbluemel
    bbluemel
    2011-01-28

    Hi erinata,

    Unfortunately no.  It seems to have a wierd effect, e.g. same snippet, this happens:

        <cfquery datasource="#dsn_name#" name="$[![queryname]!]">
        cfq $[![Query]!]
        cfq</cfquery>
        cfq<cfoutput query="$[![queryname]!]">
        cfq $[![]!]
        cfq</cfoutput>
        cfq
    

    Not sure what your code is currently, but I would imagine something along the following lines of code would do the trick (obviously needs correcting to send Scintilla the messages):

    function reindentsnippetafterinsert(int firstlineofsnippet, int lastlineofsnippet)
    {
    baseindent = SCI_GETLINEINDENTATION(firstlineofsnippet);
    for (int a = firstlineofsnippet; a <= lastlineofsnippet; a++)
    {
    lineindent = SCI_GETLINEINDENTATION(a);
    SCI_SETLINEINDENTATION(a, baseindent + lineindent);
    }
    }
    

    I'm only going by the scintilla docs, so not sure if you've tried this already and it didn't work.

     
  • bbluemel
    bbluemel
    2011-01-28

    There's a bunch of things wrong with my example, one including a should start on the firelineofsnippet+1.. but hopefully you get the gist of it. :)

     
  • erinata
    erinata
    2011-01-28

    wait ……I am doing exactly the same thing as you post……

    And the effect you show to me….it seems that I upload the wrong version of dll to the site

     
  • bbluemel
    bbluemel
    2011-01-28

    Hi erinata,

    awesome, that does the trick…. will try and use it today as part of my workflow, and report back if I find any issues :)

    Thanks for the speedy fix.

    Ben

     
  • 1. If you update to 0.4.11, all the snippet are show when you are in the edit view, (that's a problem in 0.4.4). So you can delete the accidentally added snippet there.
    3. The editing environment is largely improved in 0.4.11, I will continue to improve that.

    I missed the enhancement to see all defined snippets in edit view. This is completly sufficient in my eyes

    2. Notice that if you want a snippet for extension pl only , you should have ".pl" (without quotes) in the scope part instead of just "pl".

    I Know - but it was a typo in my message - and since SF-Forum does not allow submitted messages … :-(

    4. The whole purpose is you do not need to edit the sqlite database yourself and you can do everything in the notepad++ interface……..but I really didn't do anything to encrypt the database….

    I just tried to manipulate the database directly due to the lack of a better edit interface (which is available now). But opening your SQLite database with a standard SQLite database editor fails anyway …

    5. Dynamic hotspots function is COMING!!!!! It will be a LOT more than just . (FingerText will go to 0.5.0 when I can finally deliver this Dynamic hotspots function
    8. Multiple extensions snippet……Yes……..It's in the plan after Don point that out. What I have in mind is you can group several group of scopes together.

    Whoohoo…. !

    6. What you mean by snippet in snippet? you can definitely "chain snippet" as you can trigger one snippet containing hotspot $[!!] and press "left arrow" and tab when you are at that hotspot to trigger another snippet called AUTHOR. Is that what you need? Or I misunderstood?

    Yes and no - "snippet within snippets" means "chain snippets" but without the need to trigger another snippet by pressing TAB (should be triggered automatically …)

    Thanks for your fast (and positive) response

    Johannes

     
  • erinata
    erinata
    2011-01-28

    Thanks Ben. You are helping me to test the UNSTABLE version of an ALPHA software =P

    And speaking of unstable, This unstable 0.4.13.1 's export and import function is broken by the live search, so DON'T USE IT or IT WILL BREAK THE DATABASE. If you absolutely need to use it, please set in the FingerText.ini live_hint_update=2 and turn it off.
    It will be fixed in the next release.

    (0.4.11 is perfectly fine)

     
  • erinata
    erinata
    2011-01-28

    jbkilian:

    I see what you mean now. This is covered by the "dynamic hotspot" that I mention before. Dynamic hotspot include some special word triggering (like DATE or CURRPATH) , and chain snippet, and may be scripting support in the future. (that's why previously I said it will be a lot more than just ) Thanks for your suggestion though. They are coming.

     
  • bbluemel
    bbluemel
    2011-01-29

    erinata:
    hehe, yeah I found that out, saw that the snippets weren't exported properly so duly ignored them, and just copied the database raw.

    I have found two more bugs in 0.4.13.1:
    1) Attempting to save a file that Notepad++ can't write to, (i.e. those that require elevation (on Vista or Win7), e.g. any file in the program files or windows directories (I found it by trying to edit one of the theme files in notepad++ without elevating Notepad++ first).  FingerText will pop up a blank Yes/No dialog.  clicking Yes makes FingerText moan that "You should put an "" (without quotes) at the end of your snippet content. " and then "Please check whether if this file is opened in another program". Obviously FingerText shouldn't be trying to do anything with these files. :)
    2) Can you add some code to ignore the tab press if an autocomplete popup is active? - Fingertext essentially nukes tab based autocomplete in notepad++, it will just enter a tab into the document.

    SCI_AUTOCACTIVE
    

    is what you need to look at.
    To Reproduce, you can either turn on the Autocomplete options in Notepad++, or download my ColdFusion Lexer, start a document, and type <cfq you'll notice the autocomplete dialog comes up, press tab, and it'll just insert a tab into the document.

    Keep up the good work :)

    Ben

     
  • erinata
    erinata
    2011-01-29

    Thanks!

    For the second point…..originally FingerText won't do anything to autocompletion…….It's me who deliberately shut it down by AUTOCANCEL =P……now it's fixed and it will only cancel autocomplete when it found a matching snippet.

    I do not understand the first point though. Do you mean when you attempt to save a file in Program Files and FingerText go crazy? I cannot reproduce the problem.

    I am going to post 0.4.15…..all of you should upgrade, ESPECIALLY  BEN. The version you are using doesn't feel safe to me ~_~

     
  • erinata
    erinata
    2011-01-29

    And also, I've just discover that ben is the author of coldfusion lexer plugin!!!!! I always want to write a rails lexer plugin but I do not know where to start…..And I wish I can use the coldfusion lexer plugin and modify it into a rails lexer plugin….

    Then……I find out that I don't even know how to get it compiled =P

     
  • erinata
    erinata
    2011-01-29

    FingerText is at version 0.4.15 now.

    As I have said before, everyone should upgrade because there are many new features. But Ben and anyone who is using 0.4.13.1 MUST upgrade to this version, 0.4.13.1 is super buggy.

    New Features:
    - Indent reference, thanks Ben for letting me know that this is an important feature.
    - Live search, the snippetdock content is updating as you type
    - Tag completion, there is a new commend in menu>Plugin>FingerText> Tag completion. It will complete the tag that you are typing. For example if you type lor and use Tag completion, it will become lorem if there is a snippet tag "lorem" in your database. Obviously you should hook it to a hotkey if you plan to use it.

     
<< < 1 2 3 4 .. 7 > >> (Page 2 of 7)