Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto-mark: highlights only words visible on screen #294

Open
stosunek opened this issue Nov 6, 2015 · 7 comments
Open

Auto-mark: highlights only words visible on screen #294

stosunek opened this issue Nov 6, 2015 · 7 comments

Comments

@stosunek
Copy link

stosunek commented Nov 6, 2015

The plugin does not highlight all the words that match current word under cursor but only the words which are visible on the screen. During scrolling a document no more highlighted word appears.

@scriptum
Copy link
Member

Plugin uses delayed algorithm to save resources for huge documents and updates marks while you scrolling. Recently is had a little delay (150 ms). This commit 0801a3c should fix this issue, possibly you are using outdated version of plugin (depending on distribution).

@lpaulsen93
Copy link
Contributor

I have an actual version installed/compiled and noticed the following:

This works well ✅:

  • click on a word once
  • scroll with the mouse wheel
  • new occurrences of the word coming into the visible area are properly marked

This things do not seem to work ❌:
Issue 1:

  • click on a word once
  • scroll up or down using page up/page down keys
  • new occurrences of the word coming into the visible area NOT marked

Issue 2:

  • double click on a word (so it is being selected)
  • scroll with the mouse wheel
  • new occurrences of the word coming into the visible area NOT marked

@lpaulsen93
Copy link
Contributor

I just found out that Issue 2 is the intended/implemented behaviour. See automark/src/automark.c, lines 116-118:

/* Do not highlight while selecting text and allow other markers to work */
if (sci_has_selection(sci))
	return FALSE;

@scriptum
Copy link
Member

scroll up or down using page up/page down keys

This is the reason - while using PdUp/PgDn for scrolling, you move cursor, loosing current word selection. I have no idea how to fix that without breaking other things.

@lpaulsen93
Copy link
Contributor

This is the reason - while using PdUp/PgDn for scrolling, you move cursor, loosing current word selection. I have no idea how to fix that without breaking other things.

ohhh...of course 😊
So Issue 2 is the only one I can re-produce.

@stosunek: do you encounter the problem if you only move the cursor on a word or click once on it, or do you encounter the problem if you double-click on a word (and so select it)?

@scriptum
Copy link
Member

Issue 2 actually workaround for another Geany plugin (addons) which provides similar functionality for word highlighting (double-click). Probably there were another issues I don't remember.

@lpaulsen93
Copy link
Contributor

Except Issue 2 which is not an issue but works as designed I could not find any problems. Should this be closed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants