aboutsummaryrefslogtreecommitdiff
path: root/helix-core/src
Commit message (Collapse)AuthorAge
...
* Show surround delete and replace errors in editor (#1709)Gokul Soumya2022-02-28
| | | | | * Refactor surround commands to use early returns * Show surround delete and replace errors in editor
* Configurable auto pairs (#1624)Skyler Hawthorne2022-02-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * impl auto pairs config Implements configuration for which pairs of tokens get auto completed. In order to help with this, the logic for when *not* to auto complete has been generalized from a specific hardcoded list of characters to simply testing if the next/prev char is alphanumeric. It is possible to configure a global list of pairs as well as at the language level. The language config will take precedence over the global config. * rename AutoPair -> Pair * clean up insert_char command * remove Rc * remove some explicit cloning with another impl * fix lint * review comments * global auto-pairs = false takes precedence over language settings * make clippy happy * print out editor config on startup * move auto pairs accessor into Document * rearrange auto pair doc comment * use pattern in Froms
* Add object.movement for tree-sitter navigationGokul Soumya2022-02-15
|
* Add tree-sitter based function, class navigationGokul Soumya2022-02-15
|
* Refactor language config loading (#1658)Gokul Soumya2022-02-14
|
* Merge remote-tracking branch 'origin/master' into debugBlaž Hrastnik2022-02-13
|\
| * Replace tendril with smartstringBlaž Hrastnik2022-02-10
| | | | | | | | Slightly smaller API surface, less dependencies.
| * Show infobox with register contentsGokul Soumya2022-02-10
| |
| * Allow specifying file start position (#445)Ivan Tham2022-01-23
| | | | | | Like helix-term/src/commands.rs:3426:15
| * Fix Clippy lints in tests (#1563)Omnikar2022-01-23
| | | | | | Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
| * cargo fmt + clippy lintBlaž Hrastnik2022-01-23
| |
| * Remove some TODOsBlaž Hrastnik2022-01-23
| |
| * cleanupBlaž Hrastnik2022-01-23
| |
| * fix: ensure_grapheme_boundary_next_byte needs to index at valid charBlaž Hrastnik2022-01-23
| |
| * Speed up ensure_next_boundary during renderBlaž Hrastnik2022-01-23
| | | | | | | | | | | | | | | | | | | | | | | | | | This code: let start = ensure_grapheme_boundary_next(text, text.byte_to_char(start)); let end = ensure_grapheme_boundary_next(text, text.byte_to_char(end)); Would convert byte to char index, but then internally immediately convert back to byte index, operate on it, then convert it to char index. This change reduces the amount of time spent in ensure_grapheme_boundary from 29% to 2%.
| * Make Layer::parse take &mut tree_sitter::ParserBlaž Hrastnik2022-01-23
| |
| * Use filter_map rather than flat_mapBlaž Hrastnik2022-01-23
| |
| * Set byte range on cursor againBlaž Hrastnik2022-01-23
| |
| * Only call scopes.load() onceBlaž Hrastnik2022-01-23
| |
| * Resolve some outdated commentsBlaž Hrastnik2022-01-23
| |
| * fix: Skip modifying the root layer range, it always covers 0..maxBlaž Hrastnik2022-01-23
| |
| * Update range markers so we can determine which layers can be reusedBlaž Hrastnik2022-01-23
| |
| * Try to reuse an existing layer based on layer.rangesBlaž Hrastnik2022-01-23
| |
| * Ignore layers without highlight captures, avoid cloning rangesBlaž Hrastnik2022-01-23
| |
| * Reuse the source slice between layersBlaž Hrastnik2022-01-23
| |
| * Store theme scopes on the loader, this way theme isn't passed aroundBlaž Hrastnik2022-01-23
| |
| * syntax: Split parsing and highlightingBlaž Hrastnik2022-01-23
| |
| * add select_next_sibling and select_prev_sibling commands (#1495)Michael Davis2022-01-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * add select_next_sibling and select_prev_sibling commands * refactor objects to use higher order functions * address clippy feedback * move selection cloning into commands * add default keybindings under left/right brackets * use [+t,]+t for selecting sibling syntax nodes * setup Alt-{j,k,h,l} default keymaps for syntax selection commands * reduce boilerplate of select_next/prev_sibling in commands * import tree-sitter Node type in commands
| * fix(auto_pairs): fix auto pairs with crlf (#1470)Skyler Hawthorne2022-01-17
| | | | | | | | | | | | | | | | | | | | | | Auto pairs were resulting in incorrect ranges in the resulting when the line terminators are CRLF (i.e. Windows). It turns out this is because when we were checking if the selection was a single-width cursor, it incorrectly assumed that this would be a single char. This is not the case, as a cursor can cover a multi-code point grapheme. Therefore, we must instead explicitly work with and check graphemes to determine if the cursor should move or extend the selection. Fixes #1436
| * Update to rust 1.58, fix a bunch of optional lintsBlaž Hrastnik2022-01-16
| |
| * Use the correct language ID for JavaScript & TypeScript (#1466)Kevin Sjöberg2022-01-15
| | | | | | | | | | | | | | * Use correct language ID for JavaScript/TypeScript * Add missing slash * Only calculate fallback when needed
| * remove outdated note (#1485)Kirawi2022-01-12
| |
| * expand_selection to current node with no children (#1454)Michael Davis2022-01-08
| |
| * feat(commands): shrink_selection (#1340)Matouš Dzivjak2022-01-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * feat(commands): shrink_selection Add `shrink_selection` command that can be used to shrink previously expanded selection. To make `shrink_selection` work it was necessary to add selection history to the Document since we want to shrink the selection towards the syntax tree node that was initially selected. Selection history is cleared any time the user changes selection other way than by `expand_selection`. This ensures that we don't get some funky edge cases when user calls `shrink_selection`. Related: https://github.com/helix-editor/helix/discussions/1328 * Refactor shrink_selection, move history to view * Remove useless comment * Add default key mapping for extend&shrink selection * Rework contains_selection method * Shrink selection without expand selects first child
| * Add llvm-mir highlighting (#1398)Sebastian Neubauer2022-01-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add injection regex for more languages To support embedding them in other languages like markdown. * Add llvm-mir highlighting LLVM Machine IR is dumped as yaml files that can embed LLVM IR and Machine IR. To support this, add a llvm-mir-yaml language that uses the yaml parser, but uses different injections to highlight IR and MIR. * Update submodule with fixed multiline comments Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
| * Add basic indentation for languages without treesitter-based indentation ↵Triton1712022-01-03
| | | | | | | | | | | | | | rules (always use the indent of the current line for a new line). (#1341) Fix several bugs in the treesitter indentation calculation. Co-authored-by: Triton171 <triton0171@gmail.com>
| * Detect workspace root using language markers (#1370)Alexis Mousset2021-12-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Detect workspace root using language markers * Avoid allocating root_markers * Update helix-core/src/lib.rs Co-authored-by: Blaž Hrastnik <blaz@mxxn.io> * Update helix-core/src/lib.rs Co-authored-by: Kirawi <67773714+kirawi@users.noreply.github.com> Co-authored-by: Blaž Hrastnik <blaz@mxxn.io> Co-authored-by: Kirawi <67773714+kirawi@users.noreply.github.com>
| * feat(commands): ensure_selections_forward (#1393)Matouš Dzivjak2021-12-29
| | | | | | | | | | | | | | | | | | | | | | | | | | * feat(commands): ensure_selections_forward Add command that ensures that selections are in forward direction. Fixes: https://github.com/helix-editor/helix/issues/1332 * Add keybinding for ensure_selections_forward Add `A-:` keybinding for the ensure_selections_forward command. * Re-use range.flip for flip_selections command
| * feat(ui): file encoding in statusline (#1355)Matouš Dzivjak2021-12-25
| | | | | | | | | | | | | | | | | | | | | | * feat(ui): file encoding in statusline Display file encoding in statusline if the encoding isn't UTF-8. * Re-export encoding_rs from core From there it can be imported by other mods that rely on it.
| * feat(lsp): configurable diagnostic severity (#1325)Matouš Dzivjak2021-12-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * feat(lsp): configurable diagnostic severity Allow severity of diagnostic messages to be configured. E.g. allow turning of Hint level diagnostics. Fixes: https://github.com/helix-editor/helix/issues/1007 * Use language_config() method * Add documentation for diagnostic_severity * Use unreachable for unknown severity level * fix: documentation for diagnostic_severity config
| * Fix match brackets comment (#1346)Stuart Hinson2021-12-24
| |
| * Auto pairs selection (#1254)Skyler Hawthorne2021-12-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * use auto pairs with selections Previously, the auto pairs code was converting the user selection into its cursor form, and setting the transaction's selection to that cursor. This has the effect of destroying the user's selection if they type a pair character that gets auto completed. This fixes the code to work with the user's selection, inserting auto pairs where appropriate, but either keeping or extending the user's selection. * use movement::Direction instead of bool * assume 0-width cursor is forward
| * Apply recent nightly suggestions (#1286)Kirawi2021-12-18
| | | | | | array iterators are now implicit
| * Add auto pairs for same-char pairs (#1219)Skyler Hawthorne2021-12-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add auto pairs for same-char pairs * Add unit tests for all existing functionality * Add auto pairs for same-char pairs (quotes, etc). Account for apostrophe in prose by requiring both sides of the cursor to be non-pair chars or whitespace. This also incidentally will work for avoiding a double single quote in lifetime annotations, at least until <> is added * Slight factor of moving the cursor transform of the selection to inside the hooks. This will enable doing auto pairing with selections, and fixing the bug where auto pairs destroy the selection. Fixes #1014
| * Open files with spaces in filename, allow opening multiple files (#1231)ath32021-12-12
| |
| * Use same name used in config files for langs in docsGokul Soumya2021-12-08
| |
| * Auto generate docs for language supportGokul Soumya2021-12-08
| |
| * Remove `Clone` deriveJason Rodney Hansen2021-12-05
| |
| * Remove `FormatError`Jason Rodney Hansen2021-12-05
| |
| * Used checked_add for years and monthsJason Rodney Hansen2021-12-05
| |