Skip to content

Commit 8a2b313

Browse files
authored
Merge pull request #186 from curlpipe/0.7.4
0.7.4
2 parents 8aa69a6 + 9ba7451 commit 8a2b313

31 files changed

+2230
-625
lines changed

Cargo.lock

Lines changed: 15 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ members = [
66

77
[package]
88
name = "ox"
9-
version = "0.7.3"
9+
version = "0.7.4"
1010
edition = "2021"
1111
authors = ["Curlpipe <[email protected]>"]
1212
description = "A simple but flexible text editor."

README.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
The simple but flexible text editor
1212
<br><br>
1313
<div align="center" style="display:inline;">
14-
<img src="https://i.postimg.cc/zXB5y0r3/ox-blank.gif" width="49%">
15-
<img src="https://i.postimg.cc/pVkRV33g/ox-code.gif" width="49%">
14+
<img src="/assets/showcase.gif?raw=true" width="100%">
1615
</div>
1716
<br>
1817
</p>
1918

19+
2020
![Build Status](https://img.shields.io/github/forks/curlpipe/ox.svg?style=for-the-badge)
2121
![Build Status](https://img.shields.io/github/stars/curlpipe/ox.svg?style=for-the-badge)
2222
![License](https://img.shields.io/github/license/curlpipe/ox.svg?style=for-the-badge)
@@ -28,7 +28,7 @@ Ox is an independent text editor that can be used to write everything from text
2828
If you're looking for a text editor that...
2929
1. :feather: Is lightweight and efficient
3030
2. :wrench: Can be configured to your heart's content
31-
3. :package: Has useful features out of the box
31+
3. :package: Has useful features out of the box and a library of plug-ins for everything else
3232

3333
...then Ox is right up your street
3434

@@ -46,8 +46,12 @@ It works best on linux, but macOS and Windows are also supported.
4646

4747
### Strong configurability
4848

49-
- :electric_plug: Plug-In system where you can write your own plug-ins or integrate other people's
50-
- :wrench: A wide number of options for configuration with everything from colours to the status line to syntax highlighting being open to customisation
49+
- :electric_plug: Plug-In system where you can write your own plug-ins or choose from pre-existing ones
50+
- 💬 Discord RPC
51+
- 📗 Git integration with diffs, stats and more
52+
- 🕸️ Handy web development tools such as Emmet and live HTML viewer
53+
- ⏲️ Productivity tools such as a pomodoro timer and todo list tracker
54+
- :wrench: A wide number of options for configuration including colours, key bindings and behaviours
5155
- :moon: Ox uses Lua as a configuration language for familiarity when scripting and configuring
5256
- :handshake: A configuration assistant to quickly get Ox set up for you from the get-go
5357

@@ -62,6 +66,7 @@ It works best on linux, but macOS and Windows are also supported.
6266
- :writing_hand: Convenient shortcuts when writing code
6367
- :crossed_swords: Multi-editing features such as multiple cursors and recordable macros
6468
- :window: Splits to view multiple documents on the same screen at the same time
69+
- :file_cabinet: File tree to view, open, create, delete, copy and move files
6570

6671
### Robustness
6772

assets/showcase.gif

6.54 MB
Loading

config/.oxrc

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,23 @@ event_mapping = {
276276
editor:macro_record_stop()
277277
editor:display_info("Macro recorded")
278278
end,
279+
-- Splits
280+
["ctrl_alt_left"] = function()
281+
editor:focus_split_left()
282+
end,
283+
["ctrl_alt_right"] = function()
284+
editor:focus_split_right()
285+
end,
286+
["ctrl_alt_down"] = function()
287+
editor:focus_split_down()
288+
end,
289+
["ctrl_alt_up"] = function()
290+
editor:focus_split_up()
291+
end,
292+
-- File Tree
293+
["ctrl_space"] = function()
294+
editor:toggle_file_tree()
295+
end,
279296
}
280297

281298
-- Define user-defined commands
@@ -401,6 +418,22 @@ colors.error_bg = {41, 41, 61}
401418
colors.selection_fg = {255, 255, 255}
402419
colors.selection_bg = {59, 59, 130}
403420

421+
colors.file_tree_bg = {41, 41, 61}
422+
colors.file_tree_fg = {255, 255, 255}
423+
colors.file_tree_selection_fg = {255, 255, 255}
424+
colors.file_tree_selection_bg = {59, 59, 130}
425+
426+
colors.file_tree_red = {240, 104, 89}
427+
colors.file_tree_orange = {240, 142, 89}
428+
colors.file_tree_yellow = {240, 237, 89}
429+
colors.file_tree_green = {89, 240, 169}
430+
colors.file_tree_lightblue = {89, 225, 240}
431+
colors.file_tree_darkblue = {89, 149, 240}
432+
colors.file_tree_purple = {139, 89, 240}
433+
colors.file_tree_pink = {215, 89, 240}
434+
colors.file_tree_brown = {158, 94, 94}
435+
colors.file_tree_grey = {150, 144, 201}
436+
404437
-- Configure Line Numbers --
405438
line_numbers.enabled = true
406439
line_numbers.padding_left = 1
@@ -410,6 +443,12 @@ line_numbers.padding_right = 1
410443
terminal.mouse_enabled = true
411444
terminal.scroll_amount = 4
412445

446+
-- Configure File Tree --
447+
file_tree.width = 30
448+
file_tree.move_focus_to_file = true
449+
file_tree.icons = false
450+
file_tree.language_icons = true
451+
413452
-- Configure Tab Line --
414453
tab_line.enabled = true
415454
tab_line.separators = true

kaolinite/src/document/disk.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,11 @@ impl Document {
5353
/// disk errors.
5454
#[cfg(not(tarpaulin_include))]
5555
pub fn open<S: Into<String>>(size: Size, file_name: S) -> Result<Self> {
56+
// Try to find the absolute path and load it into the reader
5657
let file_name = file_name.into();
57-
let file = load_rope_from_reader(BufReader::new(File::open(&file_name)?));
58+
let full_path = std::fs::canonicalize(&file_name)?;
59+
let file = load_rope_from_reader(BufReader::new(File::open(&full_path)?));
60+
// Find the string representation of the absolute path
5861
let file_name = get_absolute_path(&file_name);
5962
Ok(Self {
6063
info: DocumentInfo {

0 commit comments

Comments
 (0)