mirror of
https://github.com/qvacua/vimr.git
synced 2024-12-29 00:34:26 +03:00
Refactor slightly
This commit is contained in:
parent
fc2affb75e
commit
afbdff64c3
@ -16,7 +16,6 @@ extern void server_vim_input(NSString *input);
|
||||
extern void server_delete(NSInteger count);
|
||||
extern void server_resize(int width, int height);
|
||||
extern void server_vim_input_marked_text(NSString *markedText);
|
||||
extern void server_insert_marked_text(NSString *markedText);
|
||||
extern bool server_has_dirty_docs();
|
||||
extern NSString *server_escaped_filename(NSString *filename);
|
||||
extern NSArray *server_buffers();
|
||||
|
@ -489,6 +489,12 @@ static void neovim_send_dirty_status(void **argv) {
|
||||
}
|
||||
}
|
||||
|
||||
static void insert_marked_text(NSString *markedText) {
|
||||
_marked_text = [markedText retain]; // release when the final text is input in -vimInput
|
||||
|
||||
loop_schedule(&main_loop, event_create(1, neovim_input, 1, [_marked_text retain])); // release in neovim_input
|
||||
}
|
||||
|
||||
static void delete_marked_text() {
|
||||
NSUInteger length = [_marked_text lengthOfBytesUsingEncoding:NSUTF32StringEncoding] / 4;
|
||||
|
||||
@ -678,16 +684,10 @@ void server_vim_input_marked_text(NSString *markedText) {
|
||||
}
|
||||
|
||||
// log4Debug("inserting marked text '%@' at %d:%d", markedText, _put_row, _put_column);
|
||||
server_insert_marked_text(markedText);
|
||||
insert_marked_text(markedText);
|
||||
});
|
||||
}
|
||||
|
||||
void server_insert_marked_text(NSString *markedText) {
|
||||
_marked_text = [markedText retain]; // release when the final text is input in -vimInput
|
||||
|
||||
loop_schedule(&main_loop, event_create(1, neovim_input, 1, [_marked_text retain])); // release in neovim_input
|
||||
}
|
||||
|
||||
bool server_has_dirty_docs() {
|
||||
FOR_ALL_BUFFERS(buffer) {
|
||||
if (buffer->b_p_bl == 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user