fix(frontends/lean/interactive): fix empty prefix in autocompletion
This commit is contained in:
parent
6d0a7a80af
commit
403234f29e
1 changed files with 2 additions and 1 deletions
|
|
@ -60,7 +60,8 @@ void report_completions(environment const & env, options const & opts, pos_info
|
|||
search_path const & path, char const * mod_path, break_at_pos_exception const & e, json & j) {
|
||||
g_context = e.m_token_info.m_context;
|
||||
unsigned offset = pos.second - e.m_token_info.m_pos.second;
|
||||
std::string prefix = e.m_token_info.m_token.to_string();
|
||||
// TODO(gabriel): this is broken with french quotes
|
||||
std::string prefix = e.m_token_info.m_token == name("") ? "" : e.m_token_info.m_token.to_string();
|
||||
if (auto stop = utf8_char_pos(prefix.c_str(), offset))
|
||||
prefix = prefix.substr(0, *stop);
|
||||
switch (e.m_token_info.m_context) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue