Comments (1)
Hey @TheCedarPrince. I love this suggestion! I got the feature working locally by replacing the existing methods of edit_move_right
with the following:
function edit_move_right(q::MIState)
s = state(q)
buf = s.input_buffer
completions, partial, should_complete = complete_line(s.p.complete, s, q.active_module)::Tuple{Vector{String},String,Bool}
if !eof(buf)
# move to the next base UTF8 character to the right
while true
c = char_move_right(buf)
eof(buf) && break
pos = position(buf)
nextc = read(buf,Char)
seek(buf,pos)
(textwidth(nextc) != 0 || nextc == '\n') && break
end
refresh_line(state(s))
return true
elseif should_complete && length(completions) == 1 && length(partial) > 1
# Replace word by completion
prev_pos = position(s)
push_undo(s)
edit_splice!(s, (prev_pos - sizeof(partial)) => prev_pos, completions[1])
refresh_line(state(s))
return true
end
return false
end
I had to rewrite the function to take an ::MIState
input in order to access all the necessary variables. Then, I basically just inserted the relevant code for the Tab key behavior. Normally, the right arrow key does nothing at the end of a line, but now it should complete the line if an autocomplete option is displayed (i.e., there is one unique autocomplete option and more than 1 character has been typed).
This is a quick hack, and I don't fully understand what all the State variables are doing, so I'll revise it and add some tests. But I don't see any downside to your suggested feature, so I plan to make a pull request soon.
from julia.
Related Issues (20)
- Allocations of `eachslice` with variable `dims` HOT 3
- 4x regression for loading JLLs in 1.11, or likely the first one, such as micromamba_jll HOT 7
- `pkgdir` returns wrong dir for extension if extension is in its own folder
- Extension not loaded if trigger is a strong dependency [on 1.10] HOT 6
- `libutf8proc.a: error adding symbols: file format not recognized` blocking build on Windows 11 on ARM via WSL HOT 8
- 136x regression for LazyAritifacts HOT 4
- LinearAlgebra/addmul all-NAN batman? HOT 10
- `Markdown.parse(::LazyString)` errors
- Allow `stack` on empty collection HOT 1
- Learn program HOT 1
- `+` function string concatenation hint should not apply to zero args HOT 1
- Typed comprehension with begin/end is illegal syntax HOT 1
- Julia v1.11 (all RCs) breaks package SolidStateDetectors (not caught by PkgEval due to timeout)
- REPL precompilation workload is broken HOT 1
- `MethodError` thrown while preparing to throw `InexactError` in conversion of `Rational` to `Integer` or `Complex` to `Real` HOT 2
- `with_logger(NullLogger())` allocates in v1.11 HOT 2
- Artifact string resolution fails in Quarto/Jupyter context
- Segfault when reading CSV from within the R environment HOT 3
- crash when comparing a type to a kind
- Define `isless` for 0-dim arrays
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from julia.