Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/MovingtoMars/liner
/ functions
Functions
336 in github.com/MovingtoMars/liner
⨍
Functions
336
◇
Types & classes
25
↓ 161 callers
Method
insert_str_after_cursor
Inserts a string directly after the cursor, moving the cursor to the right. Note: it is more efficient to call `insert_chars_after_cursor()` directly
src/editor.rs:412
↓ 55 callers
Method
cursor
(&self)
src/editor.rs:160
↓ 42 callers
Method
len
Number of items in history.
src/history.rs:91
↓ 25 callers
Method
display
Deletes the displayed prompt and buffer, replacing them with the current prompt and buffer
src/editor.rs:746
↓ 22 callers
Method
insert
(&mut self, start: usize, text: &[char])
src/buffer.rs:211
↓ 21 callers
Method
push
Add a command to the history buffer and remove the oldest commands when the max history size has been met. If writing to the disk is enabled, this fun
src/history.rs:98
↓ 20 callers
Method
num_chars
(&self)
src/buffer.rs:178
↓ 20 callers
Method
push
Push the given mode on to the stack.
src/keymap/vi.rs:58
↓ 19 callers
Method
move_cursor_to_start_of_line
Moves the cursor to the start of the line.
src/editor.rs:538
↓ 19 callers
Method
remove
Returns the number of characters removed.
src/buffer.rs:200
↓ 18 callers
Method
move_cursor_to
Moves the cursor to `pos`. If `pos` is past the end of the buffer, it will be clamped.
src/editor.rs:528
↓ 16 callers
Function
move_word
(ed: &mut Editor<W>, count: usize)
src/keymap/vi.rs:128
↓ 15 callers
Method
pop_mode_after_movement
(&mut self, move_type: MoveType)
src/keymap/vi.rs:361
↓ 14 callers
Method
current_buffer_mut
Returns a mutable reference to the current buffer being edited. This may be the new buffer or a buffer from history.
src/editor.rs:566
↓ 14 callers
Method
move_cursor_to_end_of_line
Moves the cursor to the end of the line.
src/editor.rs:544
↓ 14 callers
Function
move_word_ws
(ed: &mut Editor<W>, count: usize)
src/keymap/vi.rs:132
↓ 14 callers
Method
set_mode
(&mut self, mode: Mode)
src/keymap/vi.rs:340
↓ 13 callers
Method
clear
Empty the stack and return to normal mode.
src/keymap/vi.rs:53
↓ 13 callers
Method
move_count
When doing a move, 0 should behave the same as 1 as far as the count goes.
src/keymap/vi.rs:430
↓ 13 callers
Method
start_undo_group
(&mut self)
src/buffer.rs:98
↓ 12 callers
Method
current_buffer
Returns a reference to the current buffer being edited. This may be the new buffer or a buffer from history.
src/editor.rs:560
↓ 12 callers
Method
end_undo_group
(&mut self)
src/buffer.rs:102
↓ 11 callers
Method
chars
(&self)
src/buffer.rs:246
↓ 10 callers
Method
editor_mut
(&mut self)
src/keymap/mod.rs:88
↓ 9 callers
Method
insert_after_cursor
Inserts a character directly after the cursor, moving the cursor to the right.
src/editor.rs:417
↓ 9 callers
Function
move_to_end_of_word
(ed: &mut Editor<W>, count: usize)
src/keymap/vi.rs:195
↓ 9 callers
Function
move_to_end_of_word_ws
(ed: &mut Editor<W>, count: usize)
src/keymap/vi.rs:199
↓ 9 callers
Method
truncate
(&mut self, num: usize)
src/buffer.rs:250
↓ 8 callers
Method
handle_key
(&mut self, mut key: Key, handler: &mut EventHandler<W>)
src/keymap/mod.rs:11
↓ 8 callers
Method
move_cursor_left
Moves the cursor to the left by `count` characters. The cursor will not go past the start of the buffer.
src/editor.rs:501
↓ 8 callers
Function
move_word_back
(ed: &mut Editor<W>, count: usize)
src/keymap/vi.rs:203
↓ 7 callers
Method
delete_until
Deletes every character from the cursor until the given position.
src/editor.rs:474
↓ 7 callers
Method
move_cursor_right
Moves the cursor to the right by `count` characters. The cursor will not go past the end of the buffer.
src/editor.rs:513
↓ 7 callers
Function
move_word_ws_back
(ed: &mut Editor<W>, count: usize)
src/keymap/vi.rs:207
↓ 7 callers
Method
pop
(&mut self)
src/keymap/vi.rs:62
↓ 7 callers
Method
starts_with
Check if the other buffer starts with the same content as this one. Used to implement autosuggestions.
src/buffer.rs:294
↓ 7 callers
Method
undo
(&self, buf: &mut Buffer)
src/buffer.rs:26
↓ 6 callers
Method
delete_after_cursor
Deletes the character directly after the cursor. The cursor does not move. If the cursor is at the end of the line, nothing happens.
src/editor.rs:446
↓ 6 callers
Method
is_empty
Return true if the buffer is empty.
src/buffer.rs:311
↓ 6 callers
Function
is_vi_keyword
All alphanumeric characters and _ are considered valid for keywords in vi by default.
src/keymap/vi.rs:124
↓ 6 callers
Method
mode
Get the current mode. If the stack is empty, we are in normal mode.
src/keymap/vi.rs:46
↓ 6 callers
Method
move_count_right
Get the current count or the number of remaining chars in the buffer.
src/keymap/vi.rs:443
↓ 5 callers
Method
context
(&mut self)
src/editor.rs:156
↓ 5 callers
Method
current_autosuggestion
(&self)
src/editor.rs:584
↓ 5 callers
Method
delete_all_after_cursor
Deletes every character after the cursor until the end of the line.
src/editor.rs:465
↓ 5 callers
Method
lines
(&self)
src/buffer.rs:242
↓ 5 callers
Method
move_down
Move down (forwards) in history, or to the new buffer if we reach the end of history.
src/editor.rs:375
↓ 5 callers
Method
move_up
Move up (backwards) in history.
src/editor.rs:356
↓ 4 callers
Method
as_bytes
(&self)
src/buffer.rs:264
↓ 4 callers
Method
char_after
(&self, cursor: usize)
src/buffer.rs:195
↓ 4 callers
Method
commit_history
It's important to execute this function before exiting your program, as it will ensure that all history data has been written to the disk.
src/history.rs:47
↓ 4 callers
Method
delete_word_before_cursor
Deletes the word preceding the cursor. If `ignore_space_before_cursor` is true and there is space directly before the cursor, this method ignores that
src/editor.rs:337
↓ 4 callers
Method
editor
(&self)
src/keymap/mod.rs:92
↓ 4 callers
Method
file_name
Get the history file name.
src/history.rs:137
↓ 4 callers
Method
flush
(&mut self)
src/editor.rs:180
↓ 4 callers
Method
get
(cursor: usize, words: &[(usize, usize)])
src/editor.rs:30
↓ 4 callers
Method
handle_key_common
(&mut self, key: Key)
src/keymap/vi.rs:471
↓ 4 callers
Method
handle_key_core
(&mut self, key: Key)
src/keymap/vi.rs:999
↓ 4 callers
Method
normal_mode_abort
Return to normal mode.
src/keymap/vi.rs:423
↓ 4 callers
Method
pop_mode
(&mut self)
src/keymap/vi.rs:406
↓ 4 callers
Function
vi_move_word
(ed: &mut Editor<W>, move_mode: ViMoveMode, direction: ViMoveDir, count: usize)
src/keymap/vi.rs:144
↓ 4 callers
Function
vi_move_word_end
(ed: &mut Editor<W>, move_mode: ViMoveMode, direction: ViMoveDir, count: usize)
src/keymap/vi.rs:211
↓ 4 callers
Method
width
(&self)
src/buffer.rs:234
↓ 3 callers
Method
clear
Clears the screen then prints the prompt and current buffer.
src/editor.rs:349
↓ 3 callers
Method
do_on
(&self, buf: &mut Buffer)
src/buffer.rs:16
↓ 3 callers
Method
get_words_and_cursor_position
(&self)
src/editor.rs:145
↓ 3 callers
Method
go_back
(&self, cursor: &mut usize, max: usize)
src/keymap/vi.rs:99
↓ 3 callers
Method
handle_key_move_to_char
(&mut self, key: Key, movement: CharMovement)
src/keymap/vi.rs:896
↓ 3 callers
Method
handle_key_normal
(&mut self, key: Key)
src/keymap/vi.rs:558
↓ 3 callers
Method
handle_newline
XXX: Returning a bool to indicate doneness is a bit awkward, maybe change it
src/editor.rs:165
↓ 3 callers
Method
insert_chars_after_cursor
Inserts characters directly after the cursor, moving the cursor to the right.
src/editor.rs:422
↓ 3 callers
Method
into_iter
(self)
src/history.rs:190
↓ 3 callers
Method
is_currently_showing_autosuggestion
(&self)
src/editor.rs:594
↓ 3 callers
Method
move_cursor
(&self, cursor: &mut usize, max: usize, dir: ViMoveDir)
src/keymap/vi.rs:106
↓ 3 callers
Method
range_width
(&self, start: usize, end: usize)
src/buffer.rs:238
↓ 3 callers
Method
remove_raw
(&mut self, start: usize, end: usize)
src/buffer.rs:282
↓ 3 callers
Method
set_file_name
Set history file name. At the same time enable history.
src/history.rs:145
↓ 2 callers
Method
_display
(&mut self, show_autosuggest: bool)
src/editor.rs:598
↓ 2 callers
Method
accept_autosuggestion
Accept autosuggestion and copy its content into current buffer
src/editor.rs:571
↓ 2 callers
Method
advance
(&self, cursor: &mut usize, max: usize)
src/keymap/vi.rs:95
↓ 2 callers
Method
delete_before_cursor
Deletes the character directly before the cursor, moving the cursor to the left. If the cursor is at the start of the line, nothing happens.
src/editor.rs:434
↓ 2 callers
Method
delete_until_inclusive
Deletes every character from the cursor until the given position, inclusive.
src/editor.rs:487
↓ 2 callers
Method
editor_mut
(&mut self)
src/keymap/emacs.rs:120
↓ 2 callers
Function
emacs_move_word
(ed: &mut Editor<W>, direction: EmacsMoveDir)
src/keymap/emacs.rs:141
↓ 2 callers
Function
find_char
(buf: &::buffer::Buffer, start: usize, ch: char, count: usize)
src/keymap/vi.rs:269
↓ 2 callers
Function
find_char_rev
(buf: &::buffer::Buffer, start: usize, ch: char, count: usize)
src/keymap/vi.rs:280
↓ 2 callers
Method
get_word_before_cursor
(&self, ignore_space_before_cursor: bool)
src/editor.rs:313
↓ 2 callers
Method
insert_raw
(&mut self, start: usize, text: &[char])
src/buffer.rs:286
↓ 2 callers
Method
last_arg
(&self)
src/buffer.rs:174
↓ 2 callers
Method
load_history
Load history from given file name
src/history.rs:160
↓ 2 callers
Method
push_action
(&mut self, act: Action)
src/buffer.rs:169
↓ 2 callers
Method
range
(&self, start: usize, end: usize)
src/buffer.rs:226
↓ 2 callers
Method
revert
(&mut self)
src/buffer.rs:160
↓ 2 callers
Method
set_mode_preserve_last
(&mut self, mode: Mode)
src/keymap/vi.rs:349
↓ 2 callers
Function
write_to_disk
Perform write operation. If the history file does not exist, it will be created. This function is not part of the public interface. XXX: include more
src/history.rs:212
↓ 1 callers
Function
assert_buffer_actions
(start: &str, expected: &str, actions: &[Action])
src/test.rs:39
↓ 1 callers
Function
assert_cursor_pos
(s: &str, cursor: usize, expected_pos: CursorPosition)
src/test.rs:8
↓ 1 callers
Method
buffers_ref
(&self)
src/history.rs:181
↓ 1 callers
Method
char_before
(&self, cursor: usize)
src/buffer.rs:187
↓ 1 callers
Method
complete
(&mut self, handler: &mut EventHandler<W>)
src/editor.rs:252
next →
1–100 of 336, ranked by callers