Community
    • Login

    Prevent autocomplete for some file extensions

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    2 Posts 2 Posters 2.2k Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Ben FreyB Offline
      Ben Frey
      last edited by

      I’m using np++ to edit grading files for a class I TA for. I would like to avoid having autocomplete active for these files. Is there a way to accomplish that currently?

      Claudia FrankC 1 Reply Last reply Reply Quote 0
      • Claudia FrankC Offline
        Claudia Frank @Ben Frey
        last edited by

        Hello Ben-Frey,

        natively, no. What could be done is using a python script.
        But this is a bit of a hack as this script would set all chars
        you define as a stop char. But this means also you need to install
        the python script plugin. Instructions how to setup are here.

        The script would look like this

        import os
        
        ext = '.txt' # extension which shouldn't have autocompletion
        charset = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_' # chars which should prevent autocompletion
        
        def callback_BUFFERACTIVATED(args):
            filename, extension = os.path.splitext(notepad.getBufferFilename(args["bufferID"]))
            if extension == ext:
                editor.autoCStops(charset)
        
        notepad.clearCallbacks([NOTIFICATION.BUFFERACTIVATED])    
        notepad.callback(callback_BUFFERACTIVATED, [NOTIFICATION.BUFFERACTIVATED])
        

        Cheers
        Claudia

        1 Reply Last reply Reply Quote 0

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        • First post
          Last post
        The Community of users of the Notepad++ text editor.
        Powered by NodeBB | Contributors