aboutsummaryrefslogtreecommitdiff
path: root/data/core/doc/init.lua
AgeCommit message (Collapse)Author
2022-07-11Make `Doc:get_selection[s]` return if the selection was actually sortedGuldoman
2022-06-25Don't indent empty lines in a selectionGuldoman
2022-06-07initial documentation for better code completionjgmdev
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-04-27Manage return values from "replacer" function in `Doc:replace`Guldoman
Before the addition of multi-cursor support, we just returned the second return value of the "replacer" function to the caller. With the introduction of multi-cursors, we naively summed the second return values for each cursor. In some cases the "replacer" function doesn't return any second value, so we tried to do math with `nil`, thus throwing errors. Now the second return value is added to a table which is then returned to the caller.
2022-03-18Reset syntax when a filename is providedGuldoman
2022-03-17Fixed a bunch of problems. Fixed left+click not allowing for square ↵Adam Harrison
selections, fixed esc not exiting multicursor mode, and allowed cntrl+click to remove a cursor.
2022-01-19Merge branch 'master-2.0'Francesco Abbate
2021-12-30Fix problem when opening project's module documentFrancesco Abbate
It wasn't fine to call core.open_doc without filename argument and later call Doc:save without providing both the filename and the absolute filename. It was giving a Doc in an inconsistent status where self.filename was set but not self.abs_filename. Added an asset to detect early the problem if ever happens again. In turn the problem prevented the project's module hook to work if the file was newly created.
2021-12-10Delete old forgotten self.cursor_clipboardJipok
2021-12-08Make cursor_clipboard globa, not per docJipok
2021-12-06Correct paste after 'Cut/copy whole line'Jipok
2021-11-27Merge pull request #682 from Guldoman/indent_refactorAdam
Refactor how to get the indentation of a `Doc`
2021-11-23Added in cut, copy and paste to the context menu. Also removed find pattern, ↵Adam Harrison
as that's no longer a valid command. Also made it so commands only show up if their predicates are valid.
2021-11-23Manual merge of into .Adam Harrison
2021-11-20Use the new `Doc:get_indent_info` throughout `core`Guldoman
2021-11-20Add `Doc:get_indent_info`Guldoman
It returns the indentation type, size and confirmation status, used by the `Doc`.
2021-11-20Pre-populate the highlighterGuldoman
This avoids problems with calls to `[insert,remove]_notify` on lines that the highlighter has not yet added.
2021-11-20Add `soft_reset` to highlighterGuldoman
This allows clearing the `lines` table without removing entries.
2021-11-17Merge branch 'master' into replace-unpackTakase
2021-10-10Merge pull request #466 from Guldoman/new_not_dirtyFrancesco
Avoid setting a new file as dirty if it is empty
2021-10-08Improve highlither for document editsFrancesco Abbate
The syntax highlighter keep a cache of the documents like tokenization. In order to minimize the amount of tokenize re-computations we insert some emtty lines or remove some lines in the highlither lines corresponding to the lines added or removed to the document.
2021-10-07Improve highlither for document editsFrancesco Abbate
The syntax highlighter keep a cache of the documents like tokenization. In order to minimize the amount of tokenize re-computations we insert some emtty lines or remove some lines in the highlither lines corresponding to the lines added or removed to the document.
2021-10-02Sanitize selections after redoGuldoman
2021-09-08Revert horizontal scroll implementationGuldoman
2021-08-31Avoid setting a new file as dirty if it is emptyGuldoman
2021-08-31Forgot to return an 'n'.Adam Harrison
2021-08-30Fixed replace to make it multicursor-aware.Adam Harrison
2021-08-30Avoid recreating `line_numbers` table when a recalc is neededGuldoman
2021-08-30Avoid recreating tables when calculating the longest linesGuldoman
2021-08-30Fix discrepancy in max line lengthGuldoman
The line length calculated in `Doc:load` didn't account for the newline that gets added.
2021-08-30Remove line from longest lines table only if neededGuldoman
Checking if a line needs to be removed is faster than just trying to remove it.
2021-08-30Make `Doc` keep track of max line lengthGuldoman
2021-08-30Merge pull request #430 from adamharrison/vsc-multicursor-shortcutsAdam
Added in two new VSC-style multicursor shortcuts.
2021-08-29Fixed cursor movement.Adam Harrison
2021-08-29Fixed cursors moving around with removal and inserts with cursors. Also ↵Adam Harrison
fixed drawing line highlights with multicursors.
2021-08-29replace unpack() with table.unpack()takase1121
I have no idea unpack() is still used and how it still worked.
2021-08-24increase code readibilityTakase
2021-08-24add doc:get_selection_text()takase1121
2021-08-11Small fix.Adam Harrison
2021-08-10Added in a hash check to the system clipboard.Adam Harrison
2021-07-20Removed unecessary duplicates.Adam Harrison
2021-07-20Merged dev to master.Adam Harrison
2021-06-20Added Doc:on_close() for pluginsjgmdev
2021-06-18Fixed recursion error.Adam Harrison
2021-06-18Made get_selections a bit more flexible.Adam Harrison
2021-06-18Added in the ability to iterate through cursors backwards.Adam Harrison
2021-06-18Used routine to add cursors in order correctly.Adam Harrison
2021-06-18Introduced the constraint that all cursors must be in order.Adam Harrison
2021-06-18Ensured that textual inputs sort cursors so that we don't get *real* weird ↵Adam Harrison
behaviour.