summaryrefslogtreecommitdiff
path: root/gtksourceview
Commit message (Collapse)AuthorAgeFilesLines
* vim: plug leak of copied text from bufferHEADmasterChristian Hergert2023-05-171-1/+3
| | | | Related !321
* vim: use -1 for string lengthChristian Hergert2023-05-171-1/+1
| | | | | | | This will tell the lower components that the string is \0 terminated and therefore can avoid an extra string copy. Related !321
* vim: Visual replace textMateus Melchiades2023-05-171-0/+61
| | | | | | | | | | | This commit makes Vim emulation replicate the behavior of "putting" text while in visual mode. When the user presses "p" with a selected range the range's content will now be replaced by the contents of the current register. Furthermore, this commit also adds the same feature for the system clipboard by using "Ctrl + Shift + v", similar to what is present in insert mode.
* completioncontext: add more checks for proper GTaskChristian Hergert2023-05-011-0/+2
| | | | | | | We want to be certain the GTask we received is the one that was provided to the provider when requesting completion proposals. Related #319
* bufferoutputstream: be defensive about dereferencing nul byteChristian Hergert2023-04-261-1/+2
| | | | | | | | If we don't own the buffer, then we don't have a guarantee that the buffer is one byte bigger than any count/length we've received. Mke sure to only dereference that byte when we do. Related #309
* completion: remove obsolete documentationChristian Hergert2023-03-201-6/+0
| | | | Fixes #315
* mark: fix nullable introspection for category parametergwillems2023-03-201-1/+1
|
* vim: avoid small deletions in filter commandChristian Hergert2023-03-071-20/+116
| | | | | | | | | Removing text and then inserting it turns out to be really expensive when there are lots of signal handlers. Instead do what we do elsewhere and remove all of the text only to re-insert it/indent the line one by one. This fixes some issues in Builder where reformatting with = on large buffers can bring things to a hault.
* vim: janitorial cleanupChristian Hergert2023-03-071-3/+3
|
* completion: use css for row separationChristian Hergert2023-02-213-14/+12
| | | | | | | Instead of using a GtkSeparator this uses CSS to style the rows with a header line. This requires less changes in the scene graph and also allows us to avoid size request changes, meaning the box will not jitter as much during updates.
* assistant: update popover positioning immediatelyChristian Hergert2023-02-214-66/+5
| | | | | | | | | | | | Now that a lot of other layers appear to be fixed, we can ramp back up the number of repositions we do so they don't fallback to the next frame cycle. This improves the "jitter" that you feel when updating the completion results in Builder. You may want to have an up to date GTK if you're seeing issues with this as lots of invalidations are being fixed in lower layers.
* completion: requery upon user-activationChristian Hergert2023-02-171-8/+8
| | | | | | If the user requests completion manually, then re-query the various providers. Some providers may have short-circuited on interactive completion requests but will complete if user-requested.
* snippets: include top-margin in focus-positionChristian Hergert2023-02-171-1/+6
|
* snippets: dismiss completion when switching focus locationsChristian Hergert2023-02-023-0/+18
|
* build: include version functions in girChristian Hergert2023-01-261-0/+1
| | | | Fixes #308
* stylescheme: include scheme id with missing colorChristian Hergert2023-01-241-1/+1
|
* Docs: Fix RegexError referenceFeRD (Frank Dana)2023-01-101-1/+1
| | | | | | | `gi-docgen` version 2022.2 throws an error on this reference, but even if it's accepted it ends up as a 404 link. Using `[error@` correctly links to https://docs.gtk.org/glib/error.RegexError.html in the generated documentation.
* completionprovider: fix documentation for get_priority()Christian Hergert2023-01-091-1/+1
| | | | | | | This changed when porting from Builder to GtkSourceView. Update the documentation to match. Fixes #312
* Revert "init: call gtk_source_init() from library static constructor"Christian Hergert2022-12-222-176/+3
| | | | | | | | This reverts commit 441ccc244c068124ea687f379fe6935e46fcdd2b. Apparently MSVC will deadlock. Not worth the effort to have nice things. https://gitlab.gnome.org/GNOME/gtksourceview/-/issues/311
* init: call gtk_source_init() from library static constructorChristian Hergert2022-12-222-3/+176
| | | | | | | | | | | | This uses static constructors like we do in a few other GNOME libraries to initialize state up front before main() is called, or when the library is dynamically loaded via dlopen(). This allows language bindings to omit the call to GtkSource.init(). We couldn't do this in GtkSourceView 4.x and previous due to gtk_init() requiring argc/argv parameters which is no longer the case. Additionally, repeated calls to gtk_init() are ignored.
* snippets: fix :enable-snippets without completion providerChristian Hergert2022-12-021-2/+2
| | | | | | | | | | | | If we are expanding snippets, and there is no completion provider used to show the available snippets, commit 04683f367 broke the ability to reach the code which would try to expand. This attempts to preserve the existing behavior to make that work while also doing the intention of commit 04683f367 to hide the informative when it is no longer necessary (and only if a snippet was touched). Fixes #302
* gutterrenderermarks: avoid infinite loopAlberto Fanjul2022-11-181-11/+9
| | | | Go to next mark if there are no attributes on mark.
* Revert "listsnapshot: add snapshotting listmodel"Christian Hergert2022-11-183-447/+0
| | | | This reverts commit 2fce4e13d0cf6469684995c9e2a1c503e3cf889e.
* Revert "completionlistbox: lock listmodel items during snapshot"Christian Hergert2022-11-181-103/+29
| | | | This reverts commit dc73ece2b96886a778dfe34e808106e89469f1f0.
* Revert "listsnapshot: allow mismatched hold()/release()"Christian Hergert2022-11-181-9/+1
| | | | This reverts commit dc000fbd1b737f4a26139e6df6622d68a4c867e0.
* vim: ignore gtk_text_view_im_context_filter_keypressChristian Hergert2022-11-181-9/+22
| | | | | | | | | | | | | | | | There are cases while in INSERT mode that we need to handle to switch to REPLACE as well as switching to literal input. These all currently require the Control key or Escape along with the Insert key. Filtering them would return FALSE, but unforutnatley if they are not those, calling gtk_text_view_im_context_filter_keypress() will cause the text to be committed before further GtkEventControllerKey instances could process the input. That breaks other GtkSourceView features such as indenters that might trigger on the key-press. For example, Builder can reformat function arguments on `)`. Without this, that code and other key-press handlers would be completely skipped while in INSERT mode.
* Bump version for developmentChristian Hergert2022-11-171-0/+18
|
* completion: fix typo in documentationFred2022-11-171-1/+1
|
* map: defer adjustment changes to next frameChristian Hergert2022-11-171-3/+38
| | | | | | | | This helps ensure that we are not handling changes to GtkAdjustment that happen during the LAYOUT phase of the frame clock. Instead we defer it to the next frame as it's too late to affect any sort of allocations on this frame.
* listsnapshot: allow mismatched hold()/release()Christian Hergert2022-11-161-1/+9
| | | | | We can allow supplimental release, so long as we at least get a call to release().
* completionlistbox: lock listmodel items during snapshotwip/chergert/fix-completion-snapshotsChristian Hergert2022-11-161-29/+103
| | | | | | | | This avoids the GtkSourceCompletionContext (a GListModel) changes that could come in during the snapshot cycle from messing with the rows that we want to see snapshotted. Related https://gitlab.gnome.org/GNOME/gnome-builder/-/issues/1840
* listsnapshot: add snapshotting listmodelChristian Hergert2022-11-163-0/+447
| | | | | | | This is a simple GListModel that attempts to snapshot a range of items in an underlying GListModel between calls to hold(pos,len) and release(). The goal here is to have list stability during a frame clock cycle regardless of what the underlying model is doing.
* completion: add note about what when is_trigger can activateChristian Hergert2022-10-311-2/+6
| | | | Fixes #301
* vim: implement rudimentary search through previous commandsChristian Hergert2022-10-051-12/+45
| | | | | This allows using arrow keys to find other commands in the history which match the currently typed prefix.
* regex: Fix incorrect bitflag operationsMoody2022-09-291-1/+7
|
* vim: allow applications to handle gd/gDChristian Hergert2022-09-211-0/+14
|
* hover: disable context menus from hover assistantChristian Hergert2022-09-211-0/+42
| | | | | | | | | | This is a workaround until we can be sure that we can show popovers from the hover assistants. Currently, that can break input pretty badly, so this is in place to help avoid that issue by users. This basically makes it so GtkLabel (and potentially others) cannot get their sequence event to show the context menu since we don't have other mechanisms to prevent it.
* hover: don't dismiss hover request from click movementChristian Hergert2022-09-211-1/+47
| | | | | | If we click, and that causes the insertion mark to move, we don't want to cancel our request to potentially show hover information at that position or the user would have to wiggle to get it to show up.
* assistants: refuse to show assistants unless parent is mappedChristian Hergert2022-09-213-4/+13
| | | | | | If our parent widget (the source view) is not mapped, then we really don't want to be showing any additional assistants as they'd be displayed over the wrong widget (likely in a GtkStack or GtkNotebok, etc).
* view: hide all assistants when unmappingChristian Hergert2022-09-211-0/+12
| | | | | | If you switch views in a stack for exmple, we expect to get child-visible set to false, which then causes the view to unmap. Use that to ensure all our assistants are dismissed.
* completion: fix activation with empty bounds from triggerChristian Hergert2022-09-211-11/+19
| | | | | | | | | This can easily happen if you have an operator that caused the completion like "." as the symbol chars will break at the "." and leave us with bounds that are identical. If we track that the interactive completion came from a trigger, we can ignore this and assume we want to begin completion immediately.
* completioncell: fix splicing of PangoAttrListsChristian Hergert2022-09-141-1/+6
| | | | | We need to provide the length or we wont properly join the strings in all cases here.
* completion: use PANGO_UNDERLINE_SINGLE_LINEChristian Hergert2022-09-141-1/+1
| | | | | This just looks a bit better since we want to match under the whole line not just where underbar might be.
* hoverassistant: adjust target location by child left marginChristian Hergert2022-09-061-0/+9
| | | | | This way things still relatively line up with the text inside the hover assistant popover.
* hoverdisplay: give GtkSourceHoverDisplay a CSS nameChristian Hergert2022-09-061-0/+1
|
* signalgroup: port to GSignalGroupChristian Hergert2022-09-068-992/+76
| | | | | Now that we have GSignalGroup in GObject directly, we no longer need to carry our copy of the implementation in-tree. Just use GObject's directly.
* build: remove unused GtkSourceBindingGroupChristian Hergert2022-09-064-684/+0
| | | | | This isn't used anymore, and we won't need it as we have GBindingGroup upstream in GLib now.
* vapi: mark CompletionProvider methods as virtualChristian Hergert2022-09-051-0/+6
|
* searchcontext: remove nonesense codeChristian Hergert2022-09-051-1/+0
| | | | Leftover from conversion to final type.
* languagemanager: allow setting path to default RNG schemaChristian Hergert2022-09-052-4/+27
| | | | | | | This is useful so that we can use a particular path when running tests out of tree (which ensures we are testing changes) versus when running installed tests using the installation prefix (even if that is not in the search path).