bed0d1d
Fix language detection when file name begins with a `.` (#2833)
Click to expand commit body
I went to add in `zprofile` to the bash language config to get syntax
highlighting for it. After adding it in, Zed was still not highlighting
the file. I checked and saw that we are using `Path::extension()` in
`language_for_file()`, which [returns `None` when a file's name begins
with a
`.`](https://doc.rust-lang.org/std/path/struct.PathBuf.html#method.extension),
such as in the case of `.zprofile`. This PR adds a custom method, with
some tests, that just tries to grab the last component in the file name
if `Path::extension` returns `None`. Not sure if `ext` is the best name,
but I can't use `extension`.
Maybe this method should be called `extension_or_hidden_file_name()`?
Release Notes:
- Fixed a bug where language detection would fail for files starting
with `.` in their names.
- Added syntax highlighting for `.zprofile` files
Joseph T. Lyons
created
c523ccc
Fix code that identifies language via extension
0b93a30
Terminate synthetic drag state on mouse up w/ ctrl held
Click to expand commit body
Co-authored-by: Mikayla <mikayla@zed.dev>
Max Brunsfeld
and
Mikayla
created
e3bb5e5
Fix failure to remove hovered region_ids on element removal
Click to expand commit body
Co-authored-by: Mikayla <mikayla@zed.dev>
Max Brunsfeld
and
Mikayla
created
db96fb1
Merge remote-tracking branch 'origin/main' into paint-context
Nathan Sobo
created
54ca5f1
Replace context methods that take a window id with methods on window handles (#2832)
Click to expand commit body
With this PR, I've eliminated almost all references to window ids
outside of the internals of GPUI. All public methods taking these ids
are now defined on `AnyWindowHandle`, which provides a more coherent
narrative around windows as a concept.