I have been running with this PR for some time. I’m not a heavy user of snippets, but I do use a few.

I also tested this PR specifically, under Linux GTK+2, Linux GTK+3, and Windows GTK+2. Things like:


Bug: when the cursor is on or after the last cursor position (ellipsis), pressing the “Move cursor in snippet” keybinding moves the cursor to the end of the document. In more detail:

  1. Open a non-empty Python document.
  2. Put the cursor somewhere, type for, and press the “Complete snippet” keybinding. The snippet expands, and the cursor jumps to inside the parentheses in xrange(…).
  3. Press the “Move cursor in snippet” keybinding.
  4. On master, the cursor stays in place. But with this PR, the cursor jumps to the end of the document.

Bug: when the cursor is at the beginning of the document, and there’s an ellipsis right there, pressing the “Move cursor in snippet” keybinding skips that ellipsis and selects the following run of text instead. In more detail:

  1. Define a snippet like this:

    [Default]
    test=%cursor% something
    
  2. Open an empty document.

  3. Type test and press the “Complete snippet” keybinding. The snippet expands to … something.

  4. Press Home to move the cursor to the beginning.

  5. Press the “Move cursor in snippet” keybinding. The should be selected, but instead  something is selected.


Consider the main change this PR brings. Previously, cursor positions were invisible and transient. Now, they are marked with an ellipsis (as can be seen on Thomas’s screenshot), which is literally inserted into the document. It looks nice, but might have unintended side effects.

Try this:

  1. Open an empty (but existing) Python file.

  2. Type def and press the “Complete snippet” keybinding. The document now contains:

    def … (…):
        """ Function doc """
        ‌
    
  3. On Windows, this “function” actually appears in the sidebar’s Symbols pane, with a placeholder name that looks like ⛝, and at the same time, a warning is printed to the console:

    Pango: Invalid UTF-8 string passed to pango_layout_set_text()
    
  4. On Linux, nothing appears in the Symbols pane, but another warning is printed:

    geany: Warning: ignoring null tag in /home/vasiliy/tmp/untitled.py
    

This may or may not be a problem. You could as well type funny Unicode stuff manually into the document...


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.