Community
    • Login

    Prevent autocomplete for some file extensions

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    2 Posts 2 Posters 2.0k Views
    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
      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
        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
        • First post
          Last post
        The Community of users of the Notepad++ text editor.
        Powered by NodeBB | Contributors