Commit Graph

98 Commits

Author SHA1 Message Date
George Sokianos ad4c221dd8 Manual sync with 2.1.3 tag 2024-02-11 17:51:12 +00:00
George Sokianos 5c983f10b5 Merge branch 'master' into amiga2.1 2023-12-26 13:36:13 +00:00
Adam e14af4604a Reverted cursor API to something more compatible with old API. (#1674)
* Reverted cursor API to something more compatible with old API.

* Implemented discord discussion.

* Reduced thiccness of overwrite cursor.
2023-12-26 13:16:33 +00:00
ThaCuber f43cfc4a94 Text overwriting (#1495)
* added text overwriting

* rewrote `DocView:draw_caret` to not use the order of draws

* forgot to delete some old code in `DocView:draw_overlay`
also added a temporary solution to overwriting
and added the missing arguments in `DocView:draw_ime_decoration`
and fixed `DocView:draw_caret`

* accidentally broke the `draw_caret` call in `draw_overlay` in the process

* multiline

* fixed calling `Doc:get_char` as a function
that, in turn, crashed the editor because "can't index a number"

* move and rename some stuff

* remove unneeded extra check

I just had to change the `~=` to `<` in the second condition

* overwrite disregards pasting text

* disregard overwrite on selections; doc only removes selection

* Fixed error where `doc` was used, instead of `self`.

---------

Co-authored-by: ThaCuber <70547062+ThaCuber@users.noreply.github.com>
Co-authored-by: Adam Harrison <adamdharrison@gmail.com>
2023-12-26 13:16:33 +00:00
George Sokianos 1b00045146 Added codesets support for encoding switch 2023-12-18 17:19:13 +00:00
Guldoman 95c1805293 Make `DocView` aware of scrollbars sizes (#1177)
* Make `DocView:scroll_to_make_visible` aware of vertical scrollbar width

* Make `DocView` aware of horizontal scrollbar size
2023-08-07 15:26:49 +01:00
Guldoman 5758693f4f Show cursor at the start of the next line when selecting full lines (#761)
This was the previous behavior that regressed with the keymap clicks.

This also better shows that the selection extends to the next line.
2023-08-07 15:26:38 +01:00
Adam acbd8715f4 Added in explicit touchscreen keyboard support. (#1389) 2023-08-07 15:26:38 +01:00
Guldoman d0ec3aa0fe Don't calculate widths per-uft8-char when not needed (#1409) 2023-08-07 15:26:38 +01:00
vqn 9b45c9bdbd fix incorrect x_offset if opened docs have different tab sizes (#1383) 2023-08-07 15:25:06 +01:00
Guldoman a0c05791b1 Improve `DocView:get_visible_line_range` precision (#1382) 2023-08-07 15:02:19 +01:00
Guldoman 920d3ef1e3 Avoid drawing hidden text in `DocView:draw_line_text` (#1298)
* Stop drawing text past the `DocView` edge in `DocView:draw_line_text`

* Don't add draw commands if they fall outside the latest clip

The check was previously done with the window rect, so this will reduce 
a bit more the number of commands sent.
2023-08-07 15:01:50 +01:00
Guldoman 6d5c6051cd Make `DocView` aware of scrollbars sizes (#1177)
* Make `DocView:scroll_to_make_visible` aware of vertical scrollbar width

* Make `DocView` aware of horizontal scrollbar size
2023-08-07 14:51:14 +01:00
Guldoman 94b4825754 Show cursor at the start of the next line when selecting full lines (#761)
This was the previous behavior that regressed with the keymap clicks.

This also better shows that the selection extends to the next line.
2023-08-07 14:50:59 +01:00
Adam ee80b451c6 Added in explicit touchscreen keyboard support. (#1389) 2023-08-07 14:50:58 +01:00
Guldoman 146dca9188 Don't calculate widths per-uft8-char when not needed (#1409) 2023-08-07 14:50:58 +01:00
vqn 9b4a86f763 fix incorrect x_offset if opened docs have different tab sizes (#1383) 2023-08-07 14:50:58 +01:00
Guldoman be5d23557d Improve `DocView:get_visible_line_range` precision (#1382) 2023-08-07 14:50:58 +01:00
Guldoman 12bae1ec95 Avoid drawing hidden text in `DocView:draw_line_text` (#1298)
* Stop drawing text past the `DocView` edge in `DocView:draw_line_text`

* Don't add draw commands if they fall outside the latest clip

The check was previously done with the window rect, so this will reduce 
a bit more the number of commands sent.
2023-08-07 14:50:43 +01:00
Guldoman c42f01ed1f
Improve IME location updates (#1170)
* Avoid updating IME input rect if it hasn't changed
* Update the IME input rect even when the composition didn't change
* Apply IME input blocking workaround to non-Linux only
2022-12-20 20:11:13 -04:00
Jefferson González 69bccf6fcf
docview: support gutter click selection, fixes #1116 (#1169)
* docview: support gutter click selection, fixes #1116

* Added missing call to parent on_mouse_pressed

Also fixed call to selections when `shift` is pressed.

* change to arrow instead of hand

Co-authored-by: Adam <adamdharrison@gmail.com>
2022-11-01 19:34:23 -04:00
Guldoman ed226c476e
Add more options to `Scrollbar` (#1174)
* Make `Scrollbar` accept a table for its options

* Add `force_status`, `{expanded,shrinked}_size` options to `Scrollbar`

* Add `Scrollbar:set_forced_status`

* Add `config.force_scrollbar_status` to force `DocView` scrollbars status
2022-11-01 18:38:50 -04:00
jgmdev 3da6833249 docview: do not render newline fixes #1164 2022-10-21 13:56:23 -04:00
Guldoman 6b754eb628
Refactor scrollbar into its own file (#1124)
* Move scrollbar to its own file
* Don't call `Scrollbar` functions if `View` is not scrollable
* Allow horizontal scrolling in `Scrollbar`
* Add horizontal scrollbar to `View`
* Add `root:horizontal-scroll` command with `shift+wheel` keymap
* Prioritize vertical scrollbar hover
* Don't send mouse movement to vertical scrollbar when dragging horizontal one
* Fix clicking on horizontal scrollbar track
* Implement `start` scrollbar alignment
* Add documentation to `Scrollbar`
* Make `DocView` infinitely scrollable horizontally
* Handle horizontal scroll SDL event
2022-10-15 20:12:15 -04:00
Guldoman 5c2c95765e
Add IME support (#991) 2022-10-15 19:58:51 -04:00
jgmdev 3f206db69a initial documentation for better code completion 2022-06-07 22:09:34 -04:00
Guldoman 11e27c6fda
Use new `CommandView:enter` options table 2022-05-30 22:08:13 +02:00
Joshua Barretto b3278f6360 Made moving to a line beyond the end of a document move the caret column to the end of the line 2022-05-30 15:40:46 +01:00
Adam 5df1640595
Merge branch 'master' into master-2.1 2022-04-24 13:42:24 -04:00
Guldoman 4f434d1a41
Show `arrow` cursor when hovering `DocView` scrollbar track 2022-04-12 02:56:41 +02:00
Guldoman 052c140787
Fix `DocView:on_mouse_released` not considering all parameters 2022-04-12 02:38:30 +02:00
Guldoman 202e42b568
Avoid calling `View:scrollbar_overlaps_point` uselessly
`View:on_mouse_moved` already updated `self.hovered_scrollbar`, so use 
that instead.
2022-04-12 02:37:21 +02:00
Adam Harrison 11dfb5b1ca Apparenlty these were issues? What? 2022-04-03 16:44:02 -04:00
Adam 3479890ce5 Soft Line Wrapping (#636)
Added in soft line wrapping.
2022-04-03 16:44:02 -04:00
Adam Harrison 82325b6a08 Fixed a bunch of problems. Fixed left+click not allowing for square selections, fixed esc not exiting multicursor mode, and allowed cntrl+click to remove a cursor. 2022-03-17 16:55:52 -04:00
Adam 61e712db12
Fixed rendering computations for y offset. (#843)
* Fixed rendering computations for y offset.

* Force monospacing if every ascii character has the same integer advance.

* Added in explanatory comment.

* Fixed issues.

* Made lines less long.
2022-02-15 15:57:07 -05:00
Guldoman 5526041da3
Check entire selection to trigger `DocView:scroll_to_make_visible`
This is needed for example when a selection has both `line1` and `col1`
at 1, and the left arrow is pressed: `line2` and `col2` change, while
`line1` and `col1` don't, but we still want to scroll.
2022-02-11 06:16:29 +01:00
Jipok c353dd6eda Add for config.highlight_current_line new variant: no_selection 2021-12-20 16:23:01 +05:00
Adam a607ef95f9
Merge pull request #682 from Guldoman/indent_refactor
Refactor how to get the indentation of a `Doc`
2021-11-27 11:55:36 -05:00
Adam Harrison 96db380c73 Manual merge of into . 2021-11-23 15:57:22 -05:00
Guldoman 3d9901695b
Use the new `Doc:get_indent_info` throughout `core` 2021-11-20 04:37:15 +01:00
Joshua Minor 4f55555ca9 Selection expands by word or line on double or triple click followed by drag. 2021-11-19 09:46:13 -08:00
Adam c58029df8b
Merge pull request #589 from adamharrison/clicks-keymap
Added in clicks to keymap.
2021-11-16 15:49:52 -05:00
Adam Harrison 6bdcfc824d Rearranged things to make a bit more sense. 2021-11-14 15:41:28 -05:00
Adam Harrison 6f53ee1b69 Added in double, and triple clicking. 2021-11-14 15:41:28 -05:00
Adam Harrison 612818ca05 Added in clicks to keymap. 2021-11-14 15:41:28 -05:00
Guldoman b3eef15e7a
Highlight any line that contains a caret
Now lines with selections can be highlighted if they contain a caret.
2021-11-09 21:33:47 +01:00
Francesco Abbate 0d2166c9ce Correct Node's clipping rectangle
Fixing the Node's clipping rectangle make the clipping in DocView:draw()
partially redundant. This latter is now no longer needed to clip
on the right when drawing the document's lines but it still serves to
the purpose of clipping on the left, before the gutter region.
2021-10-11 09:25:38 +02:00
Francesco Abbate c7aa3ebe01 Fix clipping error in docview 2021-10-10 21:44:16 +02:00
Francesco eb79381c89
Merge pull request #521 from adamharrison/remove-font-renderer
Remove Font Renderer + CP Replace + libagg
2021-10-02 18:45:31 +02:00