[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Search]

Another possible overlay bug



Hi Raman,

I seem to have found another problem which I suspect is also related to overlays. This issue only occurs when emacspeak is loaded. Unfortunately, it is a little more dangerous than the previous problem. 

In a nutshell, it looks like the underlying buffer is getting modified when an overlay is removed. However, there is a lot of assumption and guesswork on my part here, so be wary of a completely wrong path i.e. it may not be overlay related.

The Problem.

I'm using company-mode and yasnippets. I have things setup so that when I hit tab, company mode will try to find a completion and if there are multiple completions, it will display them on screen (I'm assuming, using an overlay). 

The problem is that when I select one of the completion candidates or exit the completion (using C-g or ESC), the text UNDER the overlay is also removed. If you are using something like paredit or some form of sexp editing support, it appears that not just the text under the overlay is removed, but all the text up to (for example) the next ')'. 

As an example, below is an excerpt from one of my _javascript_ files. The ~|~ marks where point is at.

 const planui = require("./planUI");
const git = require("./git");
const Table = require("cli-table3");
const cliWidth = require("cli-width");

co~|~

function initWarning(state) {
  screen.warningMsg("Warning!", `
Target database ${state.currentTarget()} needs to be initialised for DBCM
Please either run the shell script in bin/dbcm-init.sh or execute the SQL
script in sql/dbcm-init.sql in the target database.

Note that if you use the SQL script, you also need to add the dbcm_user role
to the user you will be applying database changes with
`);
}

The cursor is just after 'o' in co. I hit tab and get a completions overlay menu with 

const
cont8inue
confirm(message)
console -> console

I select the first candidate 'const'. My cursor is now at the end of the keyword const, but the function which was in the buffer following it i.e. function initWarning(state) has now been trunctaed and only has the closing brace.  It is not in the kill ring and cannot be undone. 

What appears to be happening is that when the overlay is being removed, it is also removing the underlying text from the original buffer. In my case, because I have paredit enabled, it looks like it is removing what it thinks is the current 'sexp' element, so not just the text under the overlay, but pretty much all the text in the function. 

This is with the current git head version of emacspeak. 

I will try commenting out some of the overlay related advice and see if that makes a difference. 

Tim

--
regards,

Tim

--
Tim Cross



|May 1995 - Last Year |Current Year|


If you have questions about this archive or had problems using it, please contact us.

Contact Info Page