aboutsummaryrefslogtreecommitdiff
path: root/data/core/commands
AgeCommit message (Collapse)Author
2025-03-15Project Rework (#1455)Adam
* Initial commit to clean up projects; spun off find-file to its own plugin, removed project limit, removed the concept of a project maintaining an ordered list of files, and allowed treeview to see things like hidden files and files not actually in the project. Normalizing things, fixed typo. Abstracted root project, and made things more in line with current master behaviour. Removed unused legacy code, as well as ensured that we use absolute paths. Fixed issue with backslahes on linux, will look at windows at some point. Removed stray print. Removed orphaned function. Removed extraneous command. Fixed the ability to close project folders. Removed superceded function. Applied jgm's suggestions. * Bump modversion. * Bumped modversion and changed a few minor things. * Added in handling of ignored files. * Fixed small issue. * Fixed issue with absolute arguments. * Removed home encoding; may revert this if I can find out why it was done. * Fixed minor issue with file suggestions. * Cleaned up treeview. * Typo. * Added in visible. * Ensured that the appropriate project module is loaded. * Fixed improper rebase. * Abstracted out the storage system of the workspace plugin so other plugins can use it. * Fixed double return. * Fixed functional issue. * Added documentation. * Sumenko reports duplicate function definitions, unsure why. * Fixed minor bug with workspace. * Fixed switching projects on restart. * Harmonized spacing around asserts, and fixed an issue forgetting to set has_restarted. * Made project an object. * Removing unecessary yields. * Removed unecessary fallback. * Removed unecessary line. * Reveted backslash handling, as it doesn't seem to make any difference. * Spacing. * Only stonks. * Removed uneeded error handling. * Added in function to determine project by path, and added in deprecation warnings for legacy interface. * Removed storage module. * Typo. * Changed to use deprecation log instead of regular warn so as to not spam logs. * Fixed small bug with saving workspaces on project change. * Update data/core/init.lua ---------
2024-09-13Add primary selection support (#1729)Guldoman
* Add support for primary selections * Handle primary selection in `DocView`s
2024-06-30(fix): passed missing core.window to set_window_mode call (#1836)Adam
* (fix): passed missing core.window to set_window_mode call * Propogated fix to calls made from TitleView.
2024-01-20reorder nagview options on doc:save error to be more consistent with other ↵vqn
nagview confirmations (#1696)
2024-01-13Fix doc:create-cursor-previous/next-line with tabs (#1697)vqn
* use DocView.translate to split cursor on previous/next line * use dv.doc instead of doc()
2023-12-03fix nagbar failed save message (#1678)ThaCuber
* fix nagbar failed save message - visually separated statements with a `.` - first statement slightly rewritten - use `'` rather than `"` * yeahhhh no back to `"`
2023-11-29Text overwriting (#1495)ThaCuber
* 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-11-29Fix selecting newlines with `find-replace:select-add-{next,all}` (#1608)Guldoman
* Avoid adding existing selections in `select_add_next` * Use the first available selection as delimiter in `select_add_next` * Fix returning searches with newlines in `search.find` * Fix repeat search when the last result spanned multiple lines
2023-11-28Fix deleting indentation with multiple cursors (#1670)Guldoman
2023-06-09Show cursor at the start of the next line when selecting full lines (#761)Guldoman
This was the previous behavior that regressed with the keymap clicks. This also better shows that the selection extends to the next line.
2023-05-20Add mouse grab (#1501)Guldoman
* Add mouse grab We now also send mouse movement events only to the interested view. * Add deprecation messages handler * Make various `View`s respect `on_mouse_left` * `StatusView` * `TitleView` * `TreeView` * `ToolbarView` * Fix scrollbar in `TreeView` not updating We were in some cases sending outdated mouse positions to the scrollbar, which made it think that the mouse was hovering it. This also updates the hovered item more responsively during scroll.
2023-04-22Added in double-clicking on emptyview and tab bar. (#1478)Adam
* Added in double-clicking on emptyview and tab bar. * Fixed issue with split tabs. * Early exit if no overlapping node. * Changed category of command to tabbar. * Additional cleanup. * Changed for whether we should show tabs. * Fixed erroneous hover.
2023-04-14Merge carets after `doc:move-to-{previous,next}-char` (#1462)Guldoman
2023-04-10#1393 followup (#1463)vqn
* Fix incorrect check in doc:raw_remove Restore caret position on command doc:cut * merge cursors and fix new line in clipboard * add new line to the last copied line
2023-04-07fix cursors positions when deleting multiple selections (#1393)vqn
* correctly handle overlapping selections merge cursors in Doc:raw_remove
2023-03-29Disable `trimwhitespace` and `drawwhitespace` via their configs (#1446)Adam
Instead of completely disabling them, we now use their internal toggle. Also moved `drawwhitespace` commands inside the plugin. --- * Fixed bug where commands would show even when plugin was disbled. Also removed antiquated way of disabling. * Fixed typos. * Also moved trimwhitespace out of config, if it already has a default enabled value of false. * Changed documentation. * Clarified comments.
2023-03-03Use correct view for scrolling to `find-replace:repeat-find` results (#1400)Guldoman
2023-02-09Make tab scrolling more flexible (#1384)Guldoman
* Add `Object:{is_class_of,is_extended_by}` to check inverse relationships * Make tab scrolling more flexible This adds tab scrolling commands and connects them to mouse scroll events. This way scrolling behavior can be customized more easily. For example an alternative behavior could be: ```lua keymap.add({ ["wheelup"] = "root:switch-to-hovered-previous-tab", ["wheeldown"] = "root:switch-to-hovered-next-tab" }) ```
2023-02-06NagView: properly rescale on scale change (#1379)Jefferson González
* drop font option since style.font is always used
2023-02-06Restore in-selection replace as discussed in #1331 (#1368)Jefferson González
2023-01-30Replace globally when replacing from selection (#1331)Himura Kazuto
2022-12-20core: ported regex.gsub to faster native version (#1233)Jefferson González
* added regex.gmatch iterator and other fixes * fixed issues reported by Guldoman * push strings with fixed len just in case for binary safety * added limit to regex.gsub and use pushinteger * added description to regex.gsub limits param * replaced substitutions regex description for correctness * ignore negative limits on regex.gsub
2022-12-11feat: alert user via nagview if file cannot be saved (#1230)sammyette
* feat: alert user via nagview if file cannot be saved it will prompt the user to choose whether they want to save to another location and perform the save as command * refactor: change defer draw call to thread * feat: log error when attempting to save doc
2022-11-15Use subsyntax info in `doc:toggle-{line,block}-comments`Guldoman
2022-11-03Add `config.keep_newline_whitespace` option (#1184)Guldoman
This option will avoid removing line content when pressing enter in lines with only whitespace.
2022-11-01Improvements to multicursor copy/paste (#1123)Guldoman
* Add `Doc:get_selection_idx` * Make multicursor paste add a cursor at the end of each paste * Better manage paste of multicursor whole line copy * Document `Doc:get_selection_idx` * Keep track of last added selection in `Doc` * Make use of `doc.last_selection` in `Doc` commands * Make `Doc:get_selection` return the `Doc.last_selection` if possible
2022-10-24Apply `doc` commands to anything that extends `DocView`Guldoman
This fixes a regression caused by cf29a6a45f190c85ed3423a883307c3b9251e2d3.
2022-10-15Refactor scrollbar into its own file (#1124)Guldoman
* 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-09-13Strictly limit find/replace commands to `core.docview` (#1108)Guldoman
Without this, find/replace commands applied to the `CommandView` too, with buggy results.
2022-08-16Allow command predicates to manage parameters passed to the commandsGuldoman
When a command is performed with parameters, those are now passed to the predicate. The predicate can then return, after the validity boolean, any other value that will then be passed to the actual command. If the predicate only returns the validity boolean, the original parameters are passed through to the actual command. This allows predicates to manipulate the received parameters, and allows them to pass the result of an expensive computation to the actual command, which won't have to recalculate it. String and table predicates will now also return `core.active_view`.
2022-08-09Steps to generalize toolbar and treeview. (#1088)Adam
2022-06-25On `doc:newline` remove line content if it contains only whitespaceGuldoman
2022-06-24Fix full line cut when only a single line remainsGuldoman
2022-06-23`findreplace`: Sort last searchesGuldoman
2022-06-23`findreplace`: Fix number of total replacementsGuldoman
2022-06-02Add `text` and `select_text` to `CommandView` optionsGuldoman
2022-06-02Add `show_suggestions` to `CommandView` optionsGuldoman
2022-06-01Fix tooltip not getting removed after `find-replace:replace`Guldoman
2022-05-30Use new `CommandView:enter` options tableGuldoman
2022-05-30Made wrapping overflow optionalJoshua Barretto
2022-05-22Merge branch 'master' into master-2.1master-2.1jgmdev
2022-05-15Split out reload functionality to actual document, and added in a thread to ↵Adam Harrison
check the document, in the cases where it wouldn't be covered by dirwatch.
2022-05-15Autoreload Nagview (#942)Adam
* Modified autoreload to use new dirwatch infrastructure, and added in nagview to verify that fs changes don't stomp on our changes, unless you want them to. * Split out reload functionality to actual document, and added in a thread to check the document, in the cases where it wouldn't be covered by dirwatch. * As per request from jgmdev, added in ability to show nagview always. * Changed things over to use dirwatch. * Made sure we redrew things, added in a contingency in 'save' for times when we load a non-existent file, and added some checks.
2022-05-12Add utf8 support on doc lower and upper commandsjgmdev
2022-05-09Merge branch 'master' into master-2.1Adam
2022-05-04Open `LogView` in correct `Node`Guldoman
Using `get_active_node` might result in a locked `Node`; calling `add_view` on that `Node` throws an error. `get_active_node_default` always returns an unlocked `Node`.
2022-04-03Soft Line Wrapping (#636)Adam
Added in soft line wrapping.
2022-03-20Move cursor to the beginning or the end of its selectionGuldoman
When using `doc:move-to-{previous,next}-char` in a selection, we were moving the cursor to the character before the initial/after the last character of the selection. Now we follow what other editors do and move it to just before the initial/just after the final character.
2022-03-18Add command to create a new named DocGuldoman
2022-03-17Typo.Adam Harrison