1. 31 May, 2019 1 commit
  2. 29 May, 2019 4 commits
  3. 08 May, 2019 1 commit
  4. 29 Apr, 2019 6 commits
    • Christian Hergert's avatar
      tests: add example yaml file · 61ff68f6
      Christian Hergert authored
      This includes a couple snippets from the spec, to simplify testing.
      61ff68f6
    • Роман Донченко's avatar
      yaml.lang: improve the highlighting of quoted strings · a9c777c9
      Роман Донченко authored
      * Allow them to be multiline.
      
      * Add highlighting for escape sequences. This necessitates splitting
        the "string" context into "single-quoted-string" and
        "double-quoted-string", as the escaping rules are different.
      
      * Allow empty quoted strings ("") to be highlighted correctly. The previous
        end regex prevented the closing quote in this case to be recognized
        as such, as it required it to be preceded by at least one character.
      a9c777c9
    • Роман Донченко's avatar
      yaml.lang: fix some cases of falsely recognized map keys · d53e1abb
      Роман Донченко authored
      First, don't recognize keys inside of quoted strings. Currently, "a: b"
      is recognized as a map entry with `"a` as the key and `b"` as the value.
      Fix that by giving the "string" context a higher priority than the "map"
      context.
      
      Second, prevent some comments from being recognized as map entries.
      Specifically, cases like this:
      
       # foo: bar
      
      Even though the "map" context has lower priority than the "comment"
      context, this would still be recognized as a map entry, because the map
      regex would match the line starting with the leading space and thus be
      the leftmost match. Fix this by requiring the first character of a map
      key to not be a whitespace character.
      
      There is still a case where a map entry is recognized where it shouldn't
      be:
      
      foo # bar: baz
      
      However, I don't see a way to fix this without running into the
      performance problem described in the comment in the "map" context
      definition.
      d53e1abb
    • Роман Донченко's avatar
      yaml.lang: improve detection of block scalars · eda6cda0
      Роман Донченко authored
      Allow chomping indicators, indentation indicators, trailing whitespace
      and a trailing comment on the line with the block scalar indicator.
      See the YAML 1.2 spec, section 8.1.1.
      
      Unfortunately, we can't use the indentation indicator to determine which of
      the following lines to include in the scalar, so a block scalar with an
      indentation indicator will still be highlighted incorrectly overall, unless the
      indicator is redundant.
      eda6cda0
    • Christian Hergert's avatar
      30886111
    • Jordi Mas's avatar
      build: update build instructions · 0cf0a283
      Jordi Mas authored
      0cf0a283
  5. 28 Apr, 2019 1 commit
  6. 27 Apr, 2019 2 commits
  7. 26 Apr, 2019 4 commits
    • Christian Hergert's avatar
      sourceview: remove use of deprecated pango_find_base_dir() · 6ff0a0cd
      Christian Hergert authored
      The pango_find_base_dir() requires retriving the line text up front and
      then passing that to pango (who in turn passes it to fribidi). The various
      pango functions for this are deprecated as we should be using fribidi
      directly going forward.
      6ff0a0cd
    • Christian Hergert's avatar
      build: add expliciti fribidi dependency · 8b124f7e
      Christian Hergert authored
      We already depend on this indirectly via Pango and we can use it to
      fix deprecations. We do not need to include it in our public dependencies
      of the pkg-config file, so it is added to private requires.
      8b124f7e
    • Christian Hergert's avatar
      completion: remove use of deprecated API · 80eaf1c4
      Christian Hergert authored
      This removes the use of deprecated GdkScreen API in favor of the new
      GdkMonitor API. This required bumping to 3.22, which should be enough
      in the general case to prepare for 4.x.
      80eaf1c4
    • Christian Hergert's avatar
      build: bump GTK requirement to >= 3.22 · 1f91fe6a
      Christian Hergert authored
      This bumps the GTK requirement to 3.22 so that we can start the process
      of removing deprecations. For distributions wanting updates to
      GtkSourceView without the ability to use GTK 3.22, the gtksourceview-4-2
      will continue to provide that for you.
      
      However, primary development must now start to think about what a
      GtkSourceView will look like with GTK 4.x, and the first step is to
      start removing deprecations.
      1f91fe6a
  8. 24 Apr, 2019 10 commits
    • Christian Hergert's avatar
      utils: prefer snprintf() over g_snprintf() · 8aea7848
      Christian Hergert authored
      Calling g_snprintf() is much slower in a hot-loop than glibc snprintf()
      directly, so prefer that when we are on a platform that supports it.
      8aea7848
    • Christian Hergert's avatar
      AUTHORS: update active authors · 607d57b6
      Christian Hergert authored
      607d57b6
    • Chun-wei Fan's avatar
      build: Add instructions on building with Meson using Visual Studio · 511a74da
      Chun-wei Fan authored
      This outlines how one can carry out a build using Visual Studio via
      Meson, which replaces the previous Visual Studio projects.
      511a74da
    • Chun-wei Fan's avatar
      build: Drop the Visual Studio projects · dff943e4
      Chun-wei Fan authored
      Since the Meson build files are now updated to support building on
      Visual Studio, Meson is now the supported method of building
      GtkSourceView using Visual Studio, so it's time to drop the Visual
      Studio projects.
      
      The Meson build files are more comprehensive as:
      -It automatically builds the introspection files and 'installs' them, if
       GObject-Introspection is found.
      -The test programs are built and can be run for the build process.
      -It is much easier to build directly from a GIT checkout.
      dff943e4
    • Chun-wei Fan's avatar
      test-int2str.c: Use g_snprintf() · 411a2d46
      Chun-wei Fan authored
      snprintf() is not available on all platforms, and may work differently
      depending on the CRT implementation.  Use the g_snprintf() from GLib
      instead, since this is already GLib-using code.
      411a2d46
    • Chun-wei Fan's avatar
      gtksourceutils.c: Don't define variables in a for loop statement · e8dfda6c
      Chun-wei Fan authored
      pre-C99 compilers don't like this idea...
      
      Also change a call of snprintf() to g_snprintf() so that all supported
      platforms can build the code properly.
      e8dfda6c
    • Chun-wei Fan's avatar
      meson: Fix Visual Studio DLL builds · 39ef0bf7
      Chun-wei Fan authored
      Unfortunately, Visual Studio builds do not really like the concept of
      linking 2 static libraries and not using any sources for building a
      given DLL (it will not include those items when linking the final DLL as
      it will optimize most of the items out as the linker does not believe
      those items are being really used in the final DLL), so we need to do
      the following for the Visual Studio builds:
      
      -Define a separate GtkSourceView shared library target that contain the
       core sources *and* the word completion provider sources, along with the
       generated glib-mkenums and GResource sources.  This is actually how the
       Visual Studio projects build the sources for the GtkSourceView DLL, due
       to the same reasoning.
      
      -Declare the various internal dependencies accordingly; note that we
       still need the static core library for building the test programs.
       This means that on Visual Studio builds we need to build the core
       sources 2 times, it seems that this is unavoidable at this point.
       The build files for the tests in tests/ and testsuite/ has been updated
       accordingly so that things will build and link.  Note that for the
       test-stylescheme test, we need to ensure that we only link to the
       static core library, otherwise it will fail to link.
      
      -Update the enumeration source generating process, so that we include
       config.h during the build and so ensure that the symbols in the
       enumeration sources are properly exported.  This is necessary
       especially for the introspection builds on Visual Studio, as well as
       for the test programs.
      
      -For builds prior to Visual Studio 2013, we must include our math.h so
       that we can have a fallback implementation for round(), which is only
       provided in Visual Studio 2013 and later.
      39ef0bf7
    • Chun-wei Fan's avatar
      MSVC builds: Move our math.h to win32/ · 52352508
      Chun-wei Fan authored
      Move our math.h with the fallback round() implementation to win32/, and
      ensure that it is included for pre-2013 Visual Studio Meson builds.
      52352508
    • Chun-wei Fan's avatar
      meson.build: Don't check for GCC CFlags on MSVC · 26da2dc8
      Chun-wei Fan authored
      There's no point in doing that, and we already have a header from GLib
      that covers more or less the same items, so we ought to use it.
      26da2dc8
    • Chun-wei Fan's avatar
      meson.build: Manually search for libxml2 on MSVC if needed · 5b7386dd
      Chun-wei Fan authored
      The NMake Makefiles that come with libxml2 do not generate pkg-config
      files for us, so we need to look for the libxml2 headers and lib's
      manually if necessary on Visual Studio builds.
      5b7386dd
  9. 23 Apr, 2019 4 commits
  10. 21 Apr, 2019 3 commits
  11. 20 Apr, 2019 1 commit
    • Christian Hergert's avatar
      contextengine: clear invalid ranges if BOM is found · 54e48e9c
      Christian Hergert authored
      If we came across a BOM at the beginning of a buffer, then we will have
      an invalid range before we check for BOM. In that case, we need to to
      clear it before we proceed or some assertions (such as invalid range == 1)
      will not be met.
      
      Fixes #30
      54e48e9c
  12. 19 Apr, 2019 3 commits
    • Christian Hergert's avatar
      yaml: simplify map regex · 594d1a76
      Christian Hergert authored
      This reduces the complexity of the map check a bit and still matches the
      majority of cases that I tried.
      
      Fixes #47
      594d1a76
    • Christian Hergert's avatar
      388a08a4
    • Christian Hergert's avatar
      contextengine: disable highlighting in presence of long lines · 7aa29138
      Christian Hergert authored
      If we come across a pathologically long line (defined as 2000 characters),
      then disable highlighting. As highlighting is line-based, this allows us
      to protect ourselves and keep the text editor working as fast as
      GtkTextView is willing to support.
      
      In particular, this also helps mitigate against libpcre's insistance on
      stack-overflow'ing in some situations from long input combined with
      complex regexes.
      
      It would be nice if we could determine what type of regexes are likely to
      be a potential failure for this and only limit those, but this solution
      is more likely to have the secondary effect of improving performance for
      minified HTML, CSS, etc.
      
      I think a pre-requisite to remove this feature would be for GLib to move
      to using libpcre2 for GRegex (also allowing for JIT support) as well as
      GtkTextView improving beyond line-based layout/rendering (which probably
      requires character indexes within lines).
      
      Fixes #47
      7aa29138