Conversation
Was not sure about the theme color variable to use for selections. |
@@ -32,6 +33,31 @@ function getSearchCursor(cm, query, pos) { | |||
typeof query == "string" && query == query.toLowerCase()); | |||
} | |||
|
|||
function searchOverlay(query) { | |||
query = query.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol. this PR is crazy town, do you have some context on how you came up with it :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had a look into an example of how code mirror does highlighting of text. Basically Codemirror's addOverlay
function takes a mode object. The mode object should have a token function which is applied as each token in the file is parsed. https://codemirror.net/doc/manual.html#option_mode
The regex just escapes any special characters in the input
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should i add as comments to the code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah - i think that would help
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool .. will do!
@@ -125,6 +125,14 @@ selector in floating-scrollbar-light.css across all platforms. */ | |||
background-repeat: repeat-x; | |||
} | |||
|
|||
.cm-selecting { | |||
background: none; | |||
border-width: 1px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a minor thing, but would you mind trying outline as well. I notice that border pushes the text, which is a slight visual tick that atom and i believe other editors avoid
15b819a
to
947814e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
I spoke with Helen today and she'll share some colors as a follow up improvement.
Merging, but out of curiosity could we replace the regex escape with lodashes escape fnc.
Thanks! |
Awesome. Let's open a new PR to make it consistent. Also less scary |
ok :) |
Associated Issue: #800
Summary of Changes
Testing
npm test
npm run lint
Screenshots/Videos