[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: State of the overlay tree branch?
From: |
Eli Zaretskii |
Subject: |
Re: State of the overlay tree branch? |
Date: |
Wed, 21 Mar 2018 17:35:05 +0200 |
> From: Sebastien Chapuis <address@hidden>
> Cc: Sebastian Sturm <address@hidden>, address@hidden
> Date: Wed, 21 Mar 2018 15:14:18 +0100
>
> The language server protocol defines a position in file with zero-indexed
> line and column offsets [1]:
>
> ```
> interface Position {
> line: number;
> character: number;
> }
> ```
>
> lsp-mode uses heavily line-number-at-pos to convert an Emacs buffer
> point to a LSP position, and vice-versa [2].
line-number-at-pos is inefficient, in that it always counts from the
beginning of the buffer. By keeping already computed line numbers
around, you could make a faster implementation if you count relative
line offsets using count-lines instead.
> This can happen thousands times on each keystroke.
_Thousands_ times for _each_ keystroke? Why is that? Most keystrokes
only change a single line, so how come you need thousands of lines
recounted each time?
> If Emacs could provide a function to do the conversion very fast (or at
> least faster than with line-number-at-pos), it would be great.
Given the above, I think you need to describe the issue in more
details, before we even begin designing the solution.
- RE: State of the overlay tree branch?, (continued)
- RE: State of the overlay tree branch?, Drew Adams, 2018/03/18
- Re: State of the overlay tree branch?, Stefan Monnier, 2018/03/18
- Re: State of the overlay tree branch?, Eli Zaretskii, 2018/03/19
- Re: State of the overlay tree branch?, Stefan Monnier, 2018/03/19
- Re: State of the overlay tree branch?, Eli Zaretskii, 2018/03/19
- Re: State of the overlay tree branch?, Stefan Monnier, 2018/03/19
- Re: State of the overlay tree branch?, Eli Zaretskii, 2018/03/19
- Re: State of the overlay tree branch?, Stefan Monnier, 2018/03/19
- Re: State of the overlay tree branch?, Eli Zaretskii, 2018/03/19
Re: State of the overlay tree branch?, Sebastien Chapuis, 2018/03/21
- Re: State of the overlay tree branch?,
Eli Zaretskii <=
Re: State of the overlay tree branch?, Stefan Monnier, 2018/03/26