mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
API: Implement vim_set_current_line
This commit is contained in:
parent
d488b7de1d
commit
57df213b86
@ -136,15 +136,14 @@ void vim_change_directory(String dir, Error *err)
|
||||
try_end(err);
|
||||
}
|
||||
|
||||
String vim_get_current_line(void)
|
||||
String vim_get_current_line(Error *err)
|
||||
{
|
||||
Error stub;
|
||||
return buffer_get_line(curbuf->b_fnum, curwin->w_cursor.lnum - 1, &stub);
|
||||
return buffer_get_line(curbuf->b_fnum, curwin->w_cursor.lnum - 1, err);
|
||||
}
|
||||
|
||||
void vim_set_current_line(String line)
|
||||
void vim_set_current_line(Object line, Error *err)
|
||||
{
|
||||
abort();
|
||||
buffer_set_line(curbuf->b_fnum, curwin->w_cursor.lnum - 1, line, err);
|
||||
}
|
||||
|
||||
Object vim_get_var(bool special, String name, Error *err)
|
||||
|
@ -18,10 +18,7 @@ void vim_push_keys(String str);
|
||||
void vim_command(String str, Error *err);
|
||||
|
||||
/// Evaluates the expression str using the vim internal expression
|
||||
/// evaluator (see |expression|). Returns the expression result as:
|
||||
/// - a string if the Vim expression evaluates to a string or number
|
||||
/// - a list if the Vim expression evaluates to a Vim list
|
||||
/// - a dictionary if the Vim expression evaluates to a Vim dictionary
|
||||
/// evaluator (see |expression|).
|
||||
/// Dictionaries and lists are recursively expanded.
|
||||
///
|
||||
/// @param str The expression str
|
||||
@ -49,13 +46,15 @@ void vim_change_directory(String dir, Error *err);
|
||||
|
||||
/// Return the current line
|
||||
///
|
||||
/// @param[out] err Details of an error that may have occurred
|
||||
/// @return The current line string
|
||||
String vim_get_current_line(void);
|
||||
String vim_get_current_line(Error *err);
|
||||
|
||||
/// Sets the current line
|
||||
///
|
||||
/// @param line The line contents
|
||||
void vim_set_current_line(String line);
|
||||
/// @param[out] err Details of an error that may have occurred
|
||||
void vim_set_current_line(Object line, Error *err);
|
||||
|
||||
/// Gets a global or special variable
|
||||
///
|
||||
|
Loading…
Reference in New Issue
Block a user