1. 19 Mar, 2020 1 commit
    • Christian Hergert's avatar
      snippet: implement snippet engine · a4eae18b
      Christian Hergert authored
      This is a straightforward port of Builder's snippet system to GtkSourceView.
      A number of new objects are added as part of this commit to the
      GtkSourceView ABI.
      
       - GtkSourceSnippet provides an object representing a snippet to be inserted
         into a textview. Snippets are associated with a textview rather than a
         buffer because of incremental state that is necessary to interact with
         widgetry and event controllers. Additionally, it doesn't make sense to have
         this attached to the buffer when the view area could be different.
      
       - GtkSourceSnippetChunk is a single chunk of a snippet. A snippet contains
         zero or more chunks. A chunk can have a spec (which can be evaluated
         using variables) or text set (such as after typing in the editor). Also, a
         chunk can have a "focus-position" which allows the user to tab through the
         chunks of the snippet.
      
       - GtkSourceSnippetContext provides state which can be expanded as part of
         the snippet. This is useful to expand variables set by the application or
         filters to transform input text or other variables.
      
       - gtksourceview-snippets.c contains integration bits to be hooked into
         GtkSourceView. Keeping much of this outside of gtksourceview.c helps
         to keep things mostly self-contained but also ensures that we don't keep
         growing gtksourceview.c with complexity and size. Future additions to
         gtksourceview.c should be done this way when it makes sense (such as
         adding indenters).
      
       - GtkSourceSnippetBundle is used for multiple purposes because it is handy
         to do so without increasing the number of GObjects we need and because
         it flows naturally. It is used to parse new snippet files as well as
         merge multiple snippet files together. Furthermore, it serves as a
         GListModel with a filtered set of snippets when queried by the
         snippet manager. This type is private, however.
      
       - A completion provider is provided so that applications can use snippets
         provided by the snippet manager.
      
       - Tabbing will expand the snippet based on the current word.
      
       - The classic style scheme has been adjusted to give us access to a focus
         position tag so that they are highlighted to the user. Style schemes
         bundled with GtkSourceView will want to implement this in a future commit.
      
       - Applications can insert snippets using gtk_source_view_push_snippet().
      
       - Using the mouse or touch input to move to another chunk will cause it to
         be focused (and selected). Moving between chunks manually will cause the
         snippet to be released.
      
       - A number of snippet variables are made available as seen in other snippet
         engines, notable textmate and Visual Studio Code.
      
       - You can toggle snippets on/off in test-widget using a checkbox. The
         snippets from data/snippets/ are available based on the current
         language.
      
       - Documentation for the file format and snippet text format is provided
         as part of the gtk-doc installation.
      
       - A snippets.rng file is provided to validate snippet files
      
       - Various style schemes have gotten "snippet-focus" styles that apply
         to the focus positions of the snippet.
      a4eae18b
  2. 18 Mar, 2020 4 commits
    • Christian Hergert's avatar
      tests: disable icons for test-completion · c2caa8f7
      Christian Hergert authored
      This is a bit difficult to bridge right now because of how things are
      done in GTK 4. It also seems like GtkCellRenderer will be removed from
      GTK 4 (and definitely by 5) so we can disable this until we have a
      chance to land the new completion API.
      c2caa8f7
    • Christian Hergert's avatar
      5a643b1c
    • Christian Hergert's avatar
      lines: avoid use of style-updated · c5151aea
      Christian Hergert authored
      This API was removed in GTK 4, so we need to drop our use of it. Instead
      we will watch for CSS changes and apply that.
      
      Long term, this will work better as CSS is inhereted from parent widgets
      before 4.0 is released.
      c5151aea
    • Christian Hergert's avatar
      stylescheme: simplify CSS provider usage · 7ae597a4
      Christian Hergert authored
      Now that we aren't using widget theming API to set the cursor state, we
      can go ahead and just simplify the CSS provider to a single provider.
      
      However, we also need to apply this to the gutter since the css provider
      state is not inherited. That will change in the future, but until then we
      can just apply it directly.
      
      This fixes the background for the gutter.
      7ae597a4
  3. 17 Mar, 2020 9 commits
  4. 16 Mar, 2020 8 commits
  5. 06 Mar, 2020 18 commits