This is needed to get the last character of the "selection".
For example:
```lua
doc:get_text(1, 1, #doc.lines, math.huge)
```
will return everything but the last newline, while
```lua
doc:get_text(1, 1, #doc.lines, math.huge, true)
```
will return the last newline too.
* improve projectsearch
- stick status to top of view
- add horizontal scrolling
- added ellipsis at the end of the text if it's too long
* Reverted removal of 0 on yield.
---------
Co-authored-by: Adam Harrison <adamdharrison@gmail.com>
* Streamlined and simplified CI, and made it use lpm to install addons.
Removed universal-dmg packager, as it is not necessary under the new workflow; a regular fat binary being packaged with the normal dmg works.
Incoprorated Guldo's suggestions.
Fixed minor issue.
Fixed slight issues.
Reverted to master.
Fixed nit.
Split up packaging steps.
Sigh,.
?
Fixed up x86 build.
Split Mac into two workers with a matrix.
Sigh.
Removed unecessary lines.
More descriptive name.
Split arch workflow for Mac.
Syntax error.
Spaced things out.
Fixed mac build.
Removed unecessary steps.
Takase's suggestions.
Removed unecessary `..`.
Modified patch to reference the new lua version (hopefully no other modifications needed).
Restored logic to create bundle.
New release workflow.
Changed to welcome plugin.
Changed build.
Added in package-portable to make this easier.
Corrected compiling arch.
Harmonized formats.
Remove package portable.
Fixed universal build.
Fix mispelling.
Sigh.
Sigh.
Sigh.
Sigh.
Sigh.
Sigh.
Sigh.
Sigh.
Sigh.
Sigh.
Sigh.
* Expanded things as per Takase's request.
* Renamed Mac to Darwin.
* Fixed missing variable.
* renderer: rewrite glyph cache
This commit splits the current GlyphSet-based system into 2 caches,
CharMap and GlyphMap, which maps codepoints -> glyph IDs and glyph IDs -> glyphs respectively.
Each GlyphMap contains a number of GlyphAtlas mapped by their width,
and each GlyphAtlas has a list of surfaces with the same width.
Surfaces within the GlyphAtlas acts like a bump allocator, but is flexible
enough to allow older GlyphAtlas surfaces to be recycled.
GlyphMetric now contains atlas_idx and surface_idx, which points to the correct surface.
Since GlyphAtlas supports rudimentary packing & allocation, we no longer render whole
GlyphSets and this speeds up rendering in most cases.
Tab width is no longer set with the hacky "modify the GlyphMetric" hack.
* renderer: set natlas to 0 after freeing
* renderer: fix printf warning
* renderer: fix memory leak
* renderer: better whitespace rendering
* renderer: fix ubsan warning when casting ints
* renderer: fix tab handling
There's a bug with inconsistent tab widths caused by fontgroups.
* renderer: fix glyphs being loaded over and over
* renderer: add glyphmap size
* renderer: store per-surface offset_y and use it to find best-fitting surface
* renderer: fix MSVC compiler error
* renderer: remove return value from ren_font_glyph
* renderer: refactor xadvance calculation
* renderer: fix double free SDL_RWops if FT_Set_Pixel_Size fail
* renderer: always try .notdef before U+25A1
* renderer: disable ren_font_dump yet again
Accidentally commited this change.
* renderer: remove unused imports
* renderer: fix double free with FT_Open_Face
* renderer: return SDL_Surface in font_find_glyph_surface
* renderer: bring back metric flags for future extension
* renderer: refactor xadvance calculation into macro
* renderer: fix comment
* renderer: store GlyphMetric directly in the surface
* renderer: remove duplicated comment
* renderer: rename font_find_glyph_surface to font_allocate_glyph_surface
* renderer: refactor glyphmetric retrieval into an inline function
* renderer: do not render glyphs with bitmap set to null
This is a weird edge case, but at least it shouldn't crash
* renderer: refactor face metric code into its own function
* renderer: actually check if glyph fits in surface
* renderer: rudimentary support for non-scalable faces
At least it won't render nothing on the screen
* renderer: check for font_surface instead of metric directly
This is safe and shorter
* renderer: fix indentation
* renderer: rename GLYPH_PER_ATLAS to GLYPHS_PER_ATLAS
* renderer: rename all GLYPH_PER_ATLAS correctly
* renderer: make utf8_to_codepoint slightly more durable
* renderer: fix compiler unsigned cast warning
This is needed because we use `mtime` to determine if a file has actually changed, but on most systems this has a resolution of 1 second (and we truncate it to an integer anyways).
Without this wait, we would skip reloading a file that has been changed multiple times in the same `mtime` second, thus losing some data.
* remove scaling logic from font code
for the time being its been hardcoded to 1 for the non SDL Renderer basewin setup, so nothing is lost for non MacOS users.
will be revisited in the future when scaling is improved with SDL3 and moved into scripts.
* remove unused window_renderer argument from font functions
* move window logic to lua, pass window via argument
* rename window creation functions `*_create`, `*_destroy`, add real init
* Set active window when processing frame
* get size directly from RenWindow, get active window size from renderer
* correct reverted draw calls
* fix window not reappearing on restart
* add simple logic to persist the core window
* fix style
* add renwindow documentation
* make windows hidden by default again
* reorder ren_update_rects execution, add comment to note future work
* Initial commit of process framework.
* Fixed a small issue.
* Cleaned up old name.
* Harmonized with lua 5.4, and added documentation.
* Process is a userdata, not a table, so had to wrap it. Also added in `wait`.
* Added in documentation.
* Clarified documentation.
* Applied patch, and fixed undefined variable.
* Re-ordered documentation to be more sensible, added missing option.
* Added into start.
* Removed unecessary require.
* macos: support drag-and-drop and default file associations
* resources/macos: use LSItemContentTypes to narrow down files
* macos: support opening folders
* rootview: workaround macos weird dnd event timing
* core/rootview: rename variable and refactor if statement
* Update font scale on monitor scale change for `RENDERER` backend (macOS)
* fix(renderer): check every font of a fontgroup for scale changes in `update_font_scale`
It is needed because fonts can be reused between groups and outside of them.
So if the first font of a group has already been scaled, we still need to check if the others still needs to be scaled.
* Update language_python.lua
* Update language_python.lua
* Update language_python.lua
* implemented a better `python_type` subsyntax
* Update language_python.lua
* fixed a small error where you couldn't hint a type at a var and guive it a value at the same time
* Update language_python.lua
* Update language_python.lua
Dictionaries appear now normally
* Update language_python.lua
* added suggestions concerning strings
* commited suggestion
Co-authored-by: Guldoman <giulio.lettieri@gmail.com>
* Various changes
* Update language_python.lua
Syntax more optimized but a tiny bit more complex...
* Simplified everything
---------
Co-authored-by: Guldoman <giulio.lettieri@gmail.com>