mirror of
https://github.com/atom/atom.git
synced 2026-02-12 15:45:23 -05:00
Make getNonWordCharacters take a position
This commit is contained in:
@@ -702,7 +702,7 @@ class Cursor extends Model {
|
||||
*/
|
||||
|
||||
getNonWordCharacters () {
|
||||
return this.editor.getNonWordCharacters(this.getScopeDescriptor().getScopesArray())
|
||||
return this.editor.getNonWordCharacters(this.getBufferPosition())
|
||||
}
|
||||
|
||||
changePosition (options, fn) {
|
||||
|
||||
@@ -4106,9 +4106,9 @@ class TextEditor {
|
||||
// for the purpose of word-based cursor movements.
|
||||
//
|
||||
// Returns a {String} containing the non-word characters.
|
||||
getNonWordCharacters (scopes) {
|
||||
getNonWordCharacters (position) {
|
||||
const languageMode = this.buffer.getLanguageMode()
|
||||
return (languageMode.getNonWordCharacters && languageMode.getNonWordCharacters(scopes)) ||
|
||||
return (languageMode.getNonWordCharacters && languageMode.getNonWordCharacters(position)) ||
|
||||
this.nonWordCharacters
|
||||
}
|
||||
|
||||
|
||||
@@ -59,7 +59,8 @@ class TokenizedBuffer {
|
||||
return this.grammar.name
|
||||
}
|
||||
|
||||
getNonWordCharacters (scope) {
|
||||
getNonWordCharacters (position) {
|
||||
const scope = this.scopeDescriptorForPosition(position)
|
||||
return this.config.get('editor.nonWordCharacters', {scope})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user