This fixes the modification indicator when saving from insert mode with
a config such as
[keys.insert]
C-s = ":write"
Previously the modification indicator would be stuck showing modified
even if the buffer contents matched the disk contents when writing after
some changes in insert mode with this binding. In insert mode we do not
eagerly write undo checkpoints so that all changes made become one
checkpoint as you exit insert mode. When saving, `Document`s `changes`
`ChangeSet` would be non-empty and when there are changes we show the
buffer as modified. Then switching to normal mode would append the
changes to history, bumping the current revision past what it was when
last saved. Since the last saved revision and current revision were then
unsynced, the modification indicator would always show modified.
This matches [Kakoune's behavior]. Kakoune has a different architecture
for writes but a very similar system for history, transactions and undo
checkpoints (what it calls "undo groups"). Upon saving Kakoune creates
an undo checkpoint if there are any uncommitted changes. It does this
after the write has gone through since its writing system is different.
For our writing system it's cleaner to make the undo checkpoint before
performing the save so that the history revision increments before we
send the save event.
[Kakoune's behavior]: 80fcfebca8/src/buffer.cc (L565-L566)
Previously `gf` on `~/.config/helix` for example would error if the
entire path was selected but succeed and open a picker for the directory
contents if the selection was one one-width cursor. We need to expand
tildes for all paths instead of just the auto-detected paths.
This also refactors the `goto_file` blocks a little so that we construct
`paths` once instead of creating the Vec and immediately clearing it
when the selection is one single-width cursor.
* Add changes before insert mode undo
Fixes#11077
* Address edge cases for undo like Kakoune does
---------
Co-authored-by: Kaniel Kirby <pirate7007@runbox.com>
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
* refactor `starting_request_args` to only `ref` non-`Copy`
* refactor `needs_recompile` to only `ref` non-`Copy`
* refactor `add_workspace_folder` to only `ref` `Some`
---------
Co-authored-by: Rudxain <rudxain@localhost.localdomain>
This fix allows for multiple language servers at once which support
workspace commands. This was previously broken as just the first
language server supporting workspace commands was queried when listing
allowed worspace commands.
The fix is in two parts. Firstly, querying all workspace commands from
all language servers available and using them when actually running the
command in `lsp_workspace_command`. Secondly, doing the same in
`completers::lsp_workspace_command` such that completion still works as
expected.
The fix has one remaining issue, which I am unsure how to handle in the
best way possible, but which I also don't think should happen often:
Multiple language servers may register commands with the same name. This
will lead to that command being listed in the popup menu and in the
completion list multiple times, which can be possibly confusing. One
could disambigue them in the popover menu, but I am not sure the same
can be done for completion. When running `lsp-workspace-command` with
parameters, this behavior is "fixed" by displaying an error in that
case. I am unsure if this is the best fix for this issue in that case,
but could not find a better one.
Without providing the formatting capability, the language server might not advertise its ability to format in return, causing the :format command to be broken.
Saving while in insert mode causes issues with the modification
indicator and this is very easy to reproduce with the current state of
the auto-save hook. We can tweak the hook slightly to await the mode
switch out of insert mode to perform the save.
The debounce is preserved: if you save and then immediately exit insert
mode the debounce will be respected. If the debounce lapses while you
are in insert mode, the save occurs as you switch out of insert mode
immediately.
* gruvbox refactoring
* removed unnecessary lines
* set purple1 for operators
* changed diagnostics colors
* removed some unnecessary lines
* set diff.delta color to yellow
* removed some tag colors
* Add new color theme 'iroaseta'
* Update runtime/themes/iroaseta.toml
Co-authored-by: postsolar <120750161+postsolar@users.noreply.github.com>
* Update iroaseta.toml
Add virtual jump label theme setting
* Update runtime/themes/iroaseta.toml
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
* Update iroaseta.toml
update storage. keyword.storage. according to suggestion, and update color.
* Update iroaseta.toml
remove unused palette
* Update iroaseta.toml
add missing setting for bufferline
* Update iroaseta.toml
update diagnostic fg color
* Update iroaseta.toml
I made the config more comprehensive and took all available themes settings from the manual. Some are commented out though.
* Update iroaseta.toml
add missing colors
* Update iroaseta.toml
Made some final adjustments to the color theme to improve visibility and reduce eye strain.
* Update runtime/themes/iroaseta.toml
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
* Update runtime/themes/iroaseta.toml
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
* Update iroaseta.toml
remove redundant settings
* Update iroaseta.toml
update color name
---------
Co-authored-by: postsolar <120750161+postsolar@users.noreply.github.com>
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
* base16_default: add `ui.statusline` for `color-modes`
Signed-off-by: J. Dekker <jdek@itanimul.li>
* base16_default: add `ui.virtual` default
Previously virtual text such as LSP inlay was impossible to distinguish
from 'real' text by default.
Signed-off-by: J. Dekker <jdek@itanimul.li>
---------
Signed-off-by: J. Dekker <jdek@itanimul.li>
When parsing injections, we skip adding a new layer if there is an
existing layer covering the same range. When doing so we did not update
the parent layer ID, so some layers could have `parent` layer IDs that
pointed to a layer that no longer existed in the `layers` HopSlotMap
which could cause a panic when using `A-o`.
To fix this we update the `parent` pointer for both newly created
injection layers and reused ones.
* Implement check before adding path to files
* fix problem where directories were removed from args.files
* Revert "Implement check before adding path to files"
This reverts commit c123944d9b.
* Dissallow opening of irregular non-symlink files
* Fixed issue with creating new file from command line
* Fixed linting error.
* Optimized regularity check as suggested in review
* Created DocumentOpenError Sum Type to switch on in Application
* Forgot cargo fmt
* Update helix-term/src/application.rs
Accept suggestion in review.
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
* Moved thiserror version configuration to the workspace instead of the individual packages.
---------
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
* Fix multiple broken links in the documentation
* Apply code review suggestion
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
---------
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
* Fix jump_backwards behaviour when jumplist is at capacity
* Decrement self.current while popping from front
* Fix issue with conflicting updates to self.current
* Realised that truncate is intentional
* Use saturating_sub when decrementing current
* Fix naming of previous jump, and remove unneeded comment change
* Remove unnecessary changes in push
* Return num elements removed from front, and use in backward method
* Hide num_removed from public interface and tidy up jump location check